diff options
author | Julian Berman <Julian@GrayVines.com> | 2023-01-20 14:14:21 -0500 |
---|---|---|
committer | Julian Berman <Julian@GrayVines.com> | 2023-01-20 14:14:21 -0500 |
commit | 65afdcec79532021864acddde8e86bc727a6d137 (patch) | |
tree | 068feea5227e73dfa41b59c8ce50d34960f385c7 /json/tests | |
parent | cb1f8af3487e1df83f5f4f46e153a17851f5cb08 (diff) | |
parent | dae554c22c8dce3bd084e3e503060b92a4839385 (diff) | |
download | jsonschema-65afdcec79532021864acddde8e86bc727a6d137.tar.gz |
Merge commit 'dae554c22c8dce3bd084e3e503060b92a4839385'
* commit 'dae554c22c8dce3bd084e3e503060b92a4839385':
Squashed 'json/' changes from d21ed578a..f57d3e0cc
Diffstat (limited to 'json/tests')
-rw-r--r-- | json/tests/draft-next/ref.json | 66 | ||||
-rw-r--r-- | json/tests/draft2019-09/ref.json | 66 | ||||
-rw-r--r-- | json/tests/draft2020-12/ref.json | 66 | ||||
-rw-r--r-- | json/tests/draft7/ref.json | 66 |
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 + } + ] } ] |