* Resolve anyOf variants, handling $ref to definitions.
(anyOf: JSONSchema7[])
| 305 | * Resolve anyOf variants, handling $ref to definitions. |
| 306 | */ |
| 307 | function resolveAnyOfVariants(anyOf: JSONSchema7[]): JSONSchema7[] { |
| 308 | return anyOf |
| 309 | .map((v) => { |
| 310 | if (v.$ref) { |
| 311 | const name = v.$ref.replace(/^#\/definitions\//, ""); |
| 312 | return currentDefinitions[name] ?? v; |
| 313 | } |
| 314 | return v; |
| 315 | }) |
| 316 | .filter((v) => v.type !== "null"); |
| 317 | } |
| 318 | |
| 319 | /** |
| 320 | * Generate a polymorphic base class and variant subclasses for a discriminated union result type. |
no outgoing calls
no test coverage detected
searching dependent graphs…