(ref: string, root: JsonSchema)
| 58 | // --- Ref resolution (mirrors schema-explorer.tsx) -------------------------- |
| 59 | |
| 60 | const 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. */ |
no outgoing calls
no test coverage detected