summaryrefslogtreecommitdiff
path: root/json/output-tests/draft2019-09/output-schema.json
diff options
context:
space:
mode:
Diffstat (limited to 'json/output-tests/draft2019-09/output-schema.json')
-rw-r--r--json/output-tests/draft2019-09/output-schema.json96
1 files changed, 96 insertions, 0 deletions
diff --git a/json/output-tests/draft2019-09/output-schema.json b/json/output-tests/draft2019-09/output-schema.json
new file mode 100644
index 0000000..0a65f20
--- /dev/null
+++ b/json/output-tests/draft2019-09/output-schema.json
@@ -0,0 +1,96 @@
+{
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "$id": "https://json-schema.org/draft/2019-09/output/schema",
+ "description": "A schema that validates the minimum requirements for validation output",
+
+ "anyOf": [
+ { "$ref": "#/$defs/flag" },
+ { "$ref": "#/$defs/basic" },
+ { "$ref": "#/$defs/detailed" },
+ { "$ref": "#/$defs/verbose" }
+ ],
+ "$defs": {
+ "outputUnit":{
+ "properties": {
+ "valid": { "type": "boolean" },
+ "keywordLocation": {
+ "type": "string",
+ "format": "json-pointer"
+ },
+ "absoluteKeywordLocation": {
+ "type": "string",
+ "format": "uri"
+ },
+ "instanceLocation": {
+ "type": "string",
+ "format": "json-pointer"
+ },
+ "error": {
+ "type": "string"
+ },
+ "errors": {
+ "$ref": "#/$defs/outputUnitArray"
+ },
+ "annotations": {
+ "$ref": "#/$defs/outputUnitArray"
+ }
+ },
+ "required": [ "valid", "keywordLocation", "instanceLocation" ],
+ "allOf": [
+ {
+ "if": {
+ "properties": {
+ "valid": { "const": false }
+ }
+ },
+ "then": {
+ "anyOf": [
+ {
+ "required": [ "error" ]
+ },
+ {
+ "required": [ "errors" ]
+ }
+ ]
+ }
+ },
+ {
+ "if": {
+ "anyOf": [
+ {
+ "properties": {
+ "keywordLocation": {
+ "pattern": "/\\$ref/"
+ }
+ }
+ },
+ {
+ "properties": {
+ "keywordLocation": {
+ "pattern": "/\\$dynamicRef/"
+ }
+ }
+ }
+ ]
+ },
+ "then": {
+ "required": [ "absoluteKeywordLocation" ]
+ }
+ }
+ ]
+ },
+ "outputUnitArray": {
+ "type": "array",
+ "items": { "$ref": "#/$defs/outputUnit" }
+ },
+ "flag": {
+ "properties": {
+ "valid": { "type": "boolean" }
+ },
+ "required": [ "valid" ]
+ },
+ "basic": { "$ref": "#/$defs/outputUnit" },
+ "detailed": { "$ref": "#/$defs/outputUnit" },
+ "verbose": { "$ref": "#/$defs/outputUnit" }
+ }
+}