(jsonSchema: JsonSchema7, annotations: JsonSchemaAnnotations | undefined)
| 609 | } |
| 610 | |
| 611 | function addAnnotations(jsonSchema: JsonSchema7, annotations: JsonSchemaAnnotations | undefined): JsonSchema7 { |
| 612 | if (annotations === undefined || Object.keys(annotations).length === 0) { |
| 613 | return jsonSchema |
| 614 | } |
| 615 | if ("$ref" in jsonSchema) { |
| 616 | return { allOf: [jsonSchema], ...annotations } as any |
| 617 | } |
| 618 | return { ...jsonSchema, ...annotations } |
| 619 | } |
| 620 | |
| 621 | function getIdentifierAnnotation(ast: AST.AST): string | undefined { |
| 622 | const identifier = Option.getOrUndefined(AST.getJSONIdentifier(ast)) |
no test coverage detected