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

Function resolveRef

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

Source from the content-addressed store, hash-verified

58// --- Ref resolution (mirrors schema-explorer.tsx) --------------------------
59
60const resolveRef = (ref: string, root: JsonSchema): JsonSchema | null => {
61 const name = ref.match(/^#\/\$defs\/(.+)$/)?.[1];
62 if (!name || !root.$defs) return null;
63 return root.$defs[name] ?? null;
64};
65
66/** Fully resolve a schema, following `$ref` and unwrapping single-variant
67 * oneOf/anyOf so we can inspect the concrete shape. */

Callers 2

deepResolveFunction · 0.70
FieldControlFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected