summaryrefslogtreecommitdiff
path: root/json/tests/draft2020-12/ref.json
diff options
context:
space:
mode:
authorJulian Berman <Julian@GrayVines.com>2021-06-24 11:18:28 +0200
committerJulian Berman <Julian@GrayVines.com>2021-06-24 11:18:28 +0200
commit3f4ed46e7169ad667c16df73268edb31587f6b01 (patch)
tree60048c975048f1af17253596ad95081933c1ac95 /json/tests/draft2020-12/ref.json
parent23e210c063e3a35b8e30ec9bc8baade4924267b3 (diff)
parent6d455c83e3fd953a9e762e596c52ce1fc4bf8740 (diff)
downloadjsonschema-3f4ed46e7169ad667c16df73268edb31587f6b01.tar.gz
Merge commit '6d455c83e3fd953a9e762e596c52ce1fc4bf8740'
* commit '6d455c83e3fd953a9e762e596c52ce1fc4bf8740': Squashed 'json/' changes from 09fd353f..0aefbb3d
Diffstat (limited to 'json/tests/draft2020-12/ref.json')
-rw-r--r--json/tests/draft2020-12/ref.json104
1 files changed, 104 insertions, 0 deletions
diff --git a/json/tests/draft2020-12/ref.json b/json/tests/draft2020-12/ref.json
index cd002a0..6071a7e 100644
--- a/json/tests/draft2020-12/ref.json
+++ b/json/tests/draft2020-12/ref.json
@@ -437,5 +437,109 @@
"valid": true
}
]
+ },
+ {
+ "description": "refs with relative uris and defs",
+ "schema": {
+ "$id": "http://example.com/schema-relative-uri-defs1.json",
+ "properties": {
+ "foo": {
+ "$id": "schema-relative-uri-defs2.json",
+ "$defs": {
+ "inner": {
+ "properties": {
+ "bar": { "type": "string" }
+ }
+ }
+ },
+ "$ref": "#/$defs/inner"
+ }
+ },
+ "$ref": "schema-relative-uri-defs2.json"
+ },
+ "tests": [
+ {
+ "description": "invalid on inner field",
+ "data": {
+ "foo": {
+ "bar": 1
+ },
+ "bar": "a"
+ },
+ "valid": false
+ },
+ {
+ "description": "invalid on outer field",
+ "data": {
+ "foo": {
+ "bar": "a"
+ },
+ "bar": 1
+ },
+ "valid": false
+ },
+ {
+ "description": "valid on both fields",
+ "data": {
+ "foo": {
+ "bar": "a"
+ },
+ "bar": "a"
+ },
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "relative refs with absolute uris and defs",
+ "schema": {
+ "$id": "http://example.com/schema-refs-absolute-uris-defs1.json",
+ "properties": {
+ "foo": {
+ "$id": "http://example.com/schema-refs-absolute-uris-defs2.json",
+ "$defs": {
+ "inner": {
+ "properties": {
+ "bar": { "type": "string" }
+ }
+ }
+ },
+ "$ref": "#/$defs/inner"
+ }
+ },
+ "$ref": "schema-refs-absolute-uris-defs2.json"
+ },
+ "tests": [
+ {
+ "description": "invalid on inner field",
+ "data": {
+ "foo": {
+ "bar": 1
+ },
+ "bar": "a"
+ },
+ "valid": false
+ },
+ {
+ "description": "invalid on outer field",
+ "data": {
+ "foo": {
+ "bar": "a"
+ },
+ "bar": 1
+ },
+ "valid": false
+ },
+ {
+ "description": "valid on both fields",
+ "data": {
+ "foo": {
+ "bar": "a"
+ },
+ "bar": "a"
+ },
+ "valid": true
+ }
+ ]
}
]