| 1 | { |
| 2 | "$schema": "https://json-schema.org/v1", |
| 3 | "$id": "https://json-schema.org/v1/output/schema", |
| 4 | "description": "A schema that validates the minimum requirements for validation output", |
| 5 | |
| 6 | "anyOf": [ |
| 7 | { "$ref": "#/$defs/flag" }, |
| 8 | { "$ref": "#/$defs/basic" }, |
| 9 | { "$ref": "#/$defs/hierarchical" } |
| 10 | ], |
| 11 | "$defs": { |
| 12 | "outputUnit":{ |
| 13 | "properties": { |
| 14 | "valid": { "type": "boolean" }, |
| 15 | "evaluationPath": { |
| 16 | "type": "string", |
| 17 | "format": "json-pointer" |
| 18 | }, |
| 19 | "schemaLocation": { |
| 20 | "type": "string", |
| 21 | "format": "uri" |
| 22 | }, |
| 23 | "instanceLocation": { |
| 24 | "type": "string", |
| 25 | "format": "json-pointer" |
| 26 | }, |
| 27 | "details": { |
| 28 | "$ref": "#/$defs/outputUnitArray" |
| 29 | }, |
| 30 | "annotations": { |
| 31 | "type": "object", |
| 32 | "additionalProperties": true |
| 33 | }, |
| 34 | "droppedAnnotations": { |
| 35 | "type": "object", |
| 36 | "additionalProperties": true |
| 37 | }, |
| 38 | "errors": { |
| 39 | "type": "object", |
| 40 | "additionalProperties": { |
| 41 | "oneOf": [ |
| 42 | { "type": "string" }, |
| 43 | { |
| 44 | "type": "array", |
| 45 | "items": { "type": "string" }, |
| 46 | "minItems": 1 |
| 47 | } |
| 48 | ] |
| 49 | } |
| 50 | } |
| 51 | }, |
| 52 | "required": [ "valid", "evaluationPath", "schemaLocation", "instanceLocation" ], |
| 53 | "allOf": [ |
| 54 | { |
| 55 | "if": { |
| 56 | "anyOf": [ |
| 57 | { |
| 58 | "required": [ "errors" ] |
| 59 | }, |
| 60 | { |
| 61 | "required": [ "droppedAnnotations" ] |
| 62 | } |
| 63 | ] |
| 64 | }, |
| 65 | "then": { |
| 66 | "properties": { |
| 67 | "valid": { "const": false } |
| 68 | } |
| 69 | } |
| 70 | }, |
| 71 | { |
| 72 | "if": { |
| 73 | "required": [ "annotations" ] |
| 74 | }, |
| 75 | "then": { |
| 76 | "properties": { |
| 77 | "valid": { "const": true } |
| 78 | } |
| 79 | } |
| 80 | } |
| 81 | ] |
| 82 | }, |
| 83 | "outputUnitArray": { |
| 84 | "type": "array", |
| 85 | "items": { "$ref": "#/$defs/outputUnit" } |
| 86 | }, |
| 87 | "flag": { |
| 88 | "properties": { |
| 89 | "valid": { "type": "boolean" } |
| 90 | }, |
| 91 | "required": [ "valid" ] |
| 92 | }, |
| 93 | "basic": { |
| 94 | "properties": { |
| 95 | "valid": { "type": "boolean" }, |
| 96 | "details": { |
| 97 | "$ref": "#/$defs/outputUnitArray" |
| 98 | } |
| 99 | }, |
| 100 | "required": [ "valid", "details" ] |
| 101 | }, |
| 102 | "hierarchical": { "$ref": "#/$defs/outputUnit" } |
| 103 | } |
| 104 | } |