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

Function deepResolve

packages/react/src/components/json-schema-form.tsx:68–77  ·  view source on GitHub ↗
(schema: JsonSchema, root: JsonSchema)

Source from the content-addressed store, hash-verified

66/** Fully resolve a schema, following `$ref` and unwrapping single-variant
67 * oneOf/anyOf so we can inspect the concrete shape. */
68const deepResolve = (schema: JsonSchema, root: JsonSchema): JsonSchema => {
69 let s = schema;
70 if (s.$ref) {
71 const resolved = resolveRef(s.$ref, root);
72 if (resolved) s = resolved;
73 }
74 if (s.oneOf?.length === 1) s = deepResolve(s.oneOf[0]!, root);
75 if (s.anyOf?.length === 1) s = deepResolve(s.anyOf[0]!, root);
76 return s;
77};
78
79// --- Small schema utilities ------------------------------------------------
80

Callers 7

defaultForSchemaFunction · 0.70
isRenderableObjectSchemaFunction · 0.70
missingRequiredFieldsFunction · 0.70
JsonSchemaFormFunction · 0.70
ObjectFieldsFunction · 0.70
JsonSchemaFieldFunction · 0.70
ArrayFieldFunction · 0.70

Calls 1

resolveRefFunction · 0.70

Tested by

no test coverage detected