Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
Mirrored from https://github.com/Camo67/composio.git
Synced Nov 22, 10:45 UTC
fix(docs): use Array.isArray guard for required field and unexport processParams
Consistent Array.isArray check prevents boolean required values from being incorrectly mapped to requiredFields. Also makes processParams module-private since it's only used internally by processSchema. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sushmithamallesh committed
Feb 5, 2026 at 22:35 UTC
7349736c61208fd39bd2d813ede8f85f09f5beef
1 file changed
+2
-2
docs/lib/toolkit-schema.ts
+2
-2
@@ -2,7 +2,7 @@ import type { ParameterSchema, Tool } from '@/types/toolkit';
2
3
// Add required flag to each property based on the required array
4
// Preserves nested properties/items for object and array types
5
-export function processParams(props: any, requiredList: string[]): Record<string, ParameterSchema> | undefined {
5
+function processParams(props: any, requiredList: string[]): Record<string, ParameterSchema> | undefined {
6
if (!props || typeof props !== 'object') return undefined;
7
const result: Record<string, ParameterSchema> = {};
8
for (const [key, value] of Object.entries(props)) {
@@ -16,7 +16,7 @@ export function processParams(props: any, requiredList: string[]): Record<string
16
enum: param.enum,
17
required: requiredList.includes(key),
18
...(param.properties ? { properties: param.properties } : {}),
19
- ...(param.required ? { requiredFields: param.required } : {}),
19
+ ...(Array.isArray(param.required) ? { requiredFields: param.required } : {}),
20
...(param.items ? { items: {
21
...param.items,
22
...(Array.isArray(param.items.required) ? { requiredFields: param.items.required } : {}),