| 1 |
{ |
| 2 |
"$schema": "https://json-schema.org/draft/2019-09/schema", |
| 3 |
"$id": "https://json-schema.org/draft/2019-09/output/schema", |
| 4 |
"description": "A schema that validates the minimum requirements for validation output", |
| 5 |
|
| 6 |
"oneOf": [ |
| 7 |
{ "$ref": "#/$defs/flag" }, |
| 8 |
{ "$ref": "#/$defs/basic" }, |
| 9 |
{ "$ref": "#/$defs/detailed" }, |
| 10 |
{ "$ref": "#/$defs/verbose" } |
| 11 |
], |
| 12 |
"$defs": { |
| 13 |
"outputUnit":{ |
| 14 |
"properties": { |
| 15 |
"valid": { "type": "boolean" }, |
| 16 |
"keywordLocation": { |
| 17 |
"type": "string", |
| 18 |
"format": "uri-reference" |
| 19 |
}, |
| 20 |
"absoluteKeywordLocation": { |
| 21 |
"type": "string", |
| 22 |
"format": "uri" |
| 23 |
}, |
| 24 |
"instanceLocation": { |
| 25 |
"type": "string", |
| 26 |
"format": "uri-reference" |
| 27 |
}, |
| 28 |
"errors": { |
| 29 |
"$ref": "#/$defs/outputUnitArray" |
| 30 |
}, |
| 31 |
"annotations": { |
| 32 |
"$ref": "#/$defs/outputUnitArray" |
| 33 |
} |
| 34 |
}, |
| 35 |
"required": [ "valid", "keywordLocation", "instanceLocation" ], |
| 36 |
"allOf": [ |
| 37 |
{ |
| 38 |
"if": { |
| 39 |
"properties": { |
| 40 |
"valid": { "const": false } |
| 41 |
} |
| 42 |
}, |
| 43 |
"then": { |
| 44 |
"required": [ "errors" ] |
| 45 |
} |
| 46 |
}, |
| 47 |
{ |
| 48 |
"if": { |
| 49 |
"anyOf": [ |
| 50 |
{ |
| 51 |
"properties": { |
| 52 |
"keywordLocation": { |
| 53 |
"pattern": "/\\$ref/" |
| 54 |
} |
| 55 |
} |
| 56 |
}, |
| 57 |
{ |
| 58 |
"properties": { |
| 59 |
"keywordLocation": { |
| 60 |
"pattern": "/\\$recursiveRef/" |
| 61 |
} |
| 62 |
} |
| 63 |
} |
| 64 |
] |
| 65 |
}, |
| 66 |
"then": { |
| 67 |
"required": [ "absoluteKeywordLocation" ] |
| 68 |
} |
| 69 |
} |
| 70 |
] |
| 71 |
}, |
| 72 |
"outputUnitArray": { |
| 73 |
"type": "array", |
| 74 |
"items": { "$ref": "#/$defs/outputUnit" } |
| 75 |
}, |
| 76 |
"flag": { |
| 77 |
"properties": { |
| 78 |
"valid": { "type": "boolean" } |
| 79 |
}, |
| 80 |
"required": [ "valid" ] |
| 81 |
}, |
| 82 |
"basic": { "$ref": "#/$defs/outputUnit" }, |
| 83 |
"detailed": { "$ref": "#/$defs/outputUnit" }, |
| 84 |
"verbose": { "$ref": "#/$defs/outputUnit" } |
| 85 |
} |
| 86 |
} |