MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / mergeAllOf

Function mergeAllOf

packages/react/src/components/schema-explorer.tsx:185–200  ·  view source on GitHub ↗
(schemas: JsonSchema[], root: JsonSchema)

Source from the content-addressed store, hash-verified

183// ---------------------------------------------------------------------------
184
185const mergeAllOf = (schemas: JsonSchema[], root: JsonSchema): JsonSchema => {
186 const merged: JsonSchema = { type: "object", properties: {}, required: [] };
187 for (const s of schemas) {
188 const resolved = deepResolve(s, root);
189 if (resolved.properties) {
190 merged.properties = { ...merged.properties, ...resolved.properties };
191 }
192 if (resolved.required) {
193 merged.required = [...(merged.required ?? []), ...resolved.required];
194 }
195 if (schemaText(resolved.description) && !schemaText(merged.description)) {
196 merged.description = schemaText(resolved.description);
197 }
198 }
199 return merged;
200};
201
202// ---------------------------------------------------------------------------
203// Type label styling — plain text, no colored pills

Callers 3

getChildCountFunction · 0.85
PropertyChildrenFunction · 0.85
countTopLevelFieldsFunction · 0.85

Calls 2

schemaTextFunction · 0.85
deepResolveFunction · 0.70

Tested by

no test coverage detected