(schema: JsonSchema, root: JsonSchema)
| 66 | /** Fully resolve a schema, following `$ref` and unwrapping single-variant |
| 67 | * oneOf/anyOf so we can inspect the concrete shape. */ |
| 68 | const 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 |
no test coverage detected