( jsonSchema: JsonSchema7, jsonSchemaAnnotations: JsonSchemaAnnotations | undefined )
| 518 | } |
| 519 | |
| 520 | function mergeJsonSchemaAnnotations( |
| 521 | jsonSchema: JsonSchema7, |
| 522 | jsonSchemaAnnotations: JsonSchemaAnnotations | undefined |
| 523 | ): JsonSchema7 { |
| 524 | if (jsonSchemaAnnotations) { |
| 525 | if ("$ref" in jsonSchema) { |
| 526 | return { allOf: [jsonSchema], ...jsonSchemaAnnotations } as any |
| 527 | } |
| 528 | return { ...jsonSchema, ...jsonSchemaAnnotations } |
| 529 | } |
| 530 | return jsonSchema |
| 531 | } |
| 532 | |
| 533 | const pruneUndefined = (ast: AST.AST): AST.AST | undefined => { |
| 534 | if (Option.isNone(AST.getJSONSchemaAnnotation(ast))) { |