Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
fix(docs): prevent infinite recursion on circular schema refs
Add placeholder to refs before processing children so that circular references (A → B → A) hit the early-return check instead of causing stack overflow. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sushmithamallesh committed
Feb 4, 2026 at 13:42 UTC
69c2b40c645be50e550a9f3799f0aee18616d8c4
1 file changed
+3
docs/components/schema-generator.tsx
+3
@@ -110,6 +110,9 @@ export function generateSchemaData(
110
const id = getSchemaId(schema);
111
if (id in refs) return id;
112
113
+ // Mark as processing to prevent infinite recursion on circular refs
114
+ refs[id] = { type: 'primitive', typeName: 'any', aliasName: 'any' };
115
+
116
// For arrays, aliasName is the item type (used in "array of X" display)
117
const aliasName =
118
schema.type === 'array' && schema.items