summaryrefslogtreecommitdiff
path: root/json/tests
diff options
context:
space:
mode:
Diffstat (limited to 'json/tests')
-rw-r--r--json/tests/draft-next/ref.json66
-rw-r--r--json/tests/draft2019-09/ref.json66
-rw-r--r--json/tests/draft2020-12/ref.json66
-rw-r--r--json/tests/draft7/ref.json66
4 files changed, 264 insertions, 0 deletions
diff --git a/json/tests/draft-next/ref.json b/json/tests/draft-next/ref.json
index 7da4afb..948e2b9 100644
--- a/json/tests/draft-next/ref.json
+++ b/json/tests/draft-next/ref.json
@@ -883,5 +883,71 @@
"valid": false
}
]
+ },
+ {
+ "description": "ref to if",
+ "schema": {
+ "$ref": "http://example.com/ref/if",
+ "if": {
+ "$id": "http://example.com/ref/if",
+ "type": "integer"
+ }
+ },
+ "tests": [
+ {
+ "description": "a non-integer is invalid due to the $ref",
+ "data": "foo",
+ "valid": false
+ },
+ {
+ "description": "an integer is valid",
+ "data": 12,
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "ref to then",
+ "schema": {
+ "$ref": "http://example.com/ref/then",
+ "then": {
+ "$id": "http://example.com/ref/then",
+ "type": "integer"
+ }
+ },
+ "tests": [
+ {
+ "description": "a non-integer is invalid due to the $ref",
+ "data": "foo",
+ "valid": false
+ },
+ {
+ "description": "an integer is valid",
+ "data": 12,
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "ref to else",
+ "schema": {
+ "$ref": "http://example.com/ref/else",
+ "else": {
+ "$id": "http://example.com/ref/else",
+ "type": "integer"
+ }
+ },
+ "tests": [
+ {
+ "description": "a non-integer is invalid due to the $ref",
+ "data": "foo",
+ "valid": false
+ },
+ {
+ "description": "an integer is valid",
+ "data": 12,
+ "valid": true
+ }
+ ]
}
]
diff --git a/json/tests/draft2019-09/ref.json b/json/tests/draft2019-09/ref.json
index f8c03be..ac651ad 100644
--- a/json/tests/draft2019-09/ref.json
+++ b/json/tests/draft2019-09/ref.json
@@ -883,5 +883,71 @@
"valid": false
}
]
+ },
+ {
+ "description": "ref to if",
+ "schema": {
+ "$ref": "http://example.com/ref/if",
+ "if": {
+ "$id": "http://example.com/ref/if",
+ "type": "integer"
+ }
+ },
+ "tests": [
+ {
+ "description": "a non-integer is invalid due to the $ref",
+ "data": "foo",
+ "valid": false
+ },
+ {
+ "description": "an integer is valid",
+ "data": 12,
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "ref to then",
+ "schema": {
+ "$ref": "http://example.com/ref/then",
+ "then": {
+ "$id": "http://example.com/ref/then",
+ "type": "integer"
+ }
+ },
+ "tests": [
+ {
+ "description": "a non-integer is invalid due to the $ref",
+ "data": "foo",
+ "valid": false
+ },
+ {
+ "description": "an integer is valid",
+ "data": 12,
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "ref to else",
+ "schema": {
+ "$ref": "http://example.com/ref/else",
+ "else": {
+ "$id": "http://example.com/ref/else",
+ "type": "integer"
+ }
+ },
+ "tests": [
+ {
+ "description": "a non-integer is invalid due to the $ref",
+ "data": "foo",
+ "valid": false
+ },
+ {
+ "description": "an integer is valid",
+ "data": 12,
+ "valid": true
+ }
+ ]
}
]
diff --git a/json/tests/draft2020-12/ref.json b/json/tests/draft2020-12/ref.json
index 45803df..eb8bf96 100644
--- a/json/tests/draft2020-12/ref.json
+++ b/json/tests/draft2020-12/ref.json
@@ -883,5 +883,71 @@
"valid": false
}
]
+ },
+ {
+ "description": "ref to if",
+ "schema": {
+ "$ref": "http://example.com/ref/if",
+ "if": {
+ "$id": "http://example.com/ref/if",
+ "type": "integer"
+ }
+ },
+ "tests": [
+ {
+ "description": "a non-integer is invalid due to the $ref",
+ "data": "foo",
+ "valid": false
+ },
+ {
+ "description": "an integer is valid",
+ "data": 12,
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "ref to then",
+ "schema": {
+ "$ref": "http://example.com/ref/then",
+ "then": {
+ "$id": "http://example.com/ref/then",
+ "type": "integer"
+ }
+ },
+ "tests": [
+ {
+ "description": "a non-integer is invalid due to the $ref",
+ "data": "foo",
+ "valid": false
+ },
+ {
+ "description": "an integer is valid",
+ "data": 12,
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "ref to else",
+ "schema": {
+ "$ref": "http://example.com/ref/else",
+ "else": {
+ "$id": "http://example.com/ref/else",
+ "type": "integer"
+ }
+ },
+ "tests": [
+ {
+ "description": "a non-integer is invalid due to the $ref",
+ "data": "foo",
+ "valid": false
+ },
+ {
+ "description": "an integer is valid",
+ "data": 12,
+ "valid": true
+ }
+ ]
}
]
diff --git a/json/tests/draft7/ref.json b/json/tests/draft7/ref.json
index ab67f0e..c9daf8f 100644
--- a/json/tests/draft7/ref.json
+++ b/json/tests/draft7/ref.json
@@ -818,5 +818,71 @@
"valid": false
}
]
+ },
+ {
+ "description": "ref to if",
+ "schema": {
+ "$ref": "http://example.com/ref/if",
+ "if": {
+ "$id": "http://example.com/ref/if",
+ "type": "integer"
+ }
+ },
+ "tests": [
+ {
+ "description": "a non-integer is invalid due to the $ref",
+ "data": "foo",
+ "valid": false
+ },
+ {
+ "description": "an integer is valid",
+ "data": 12,
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "ref to then",
+ "schema": {
+ "$ref": "http://example.com/ref/then",
+ "then": {
+ "$id": "http://example.com/ref/then",
+ "type": "integer"
+ }
+ },
+ "tests": [
+ {
+ "description": "a non-integer is invalid due to the $ref",
+ "data": "foo",
+ "valid": false
+ },
+ {
+ "description": "an integer is valid",
+ "data": 12,
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "ref to else",
+ "schema": {
+ "$ref": "http://example.com/ref/else",
+ "else": {
+ "$id": "http://example.com/ref/else",
+ "type": "integer"
+ }
+ },
+ "tests": [
+ {
+ "description": "a non-integer is invalid due to the $ref",
+ "data": "foo",
+ "valid": false
+ },
+ {
+ "description": "an integer is valid",
+ "data": 12,
+ "valid": true
+ }
+ ]
}
]