summaryrefslogtreecommitdiff
path: root/json
diff options
context:
space:
mode:
authorJulian Berman <Julian@GrayVines.com>2022-07-25 18:34:14 +0300
committerJulian Berman <Julian@GrayVines.com>2022-07-25 18:34:14 +0300
commit3ca05dc5db0b8538205fe6015197af0cfaa453d7 (patch)
treefa8ac3e289f6c5ca8ef6ae9b1c3ee565f5059eb7 /json
parent72c3200d9b14139c9ab3094d0da4c0dd68acafe3 (diff)
parent999ff68a38729aaebe8b5b772b789b97dc145820 (diff)
downloadjsonschema-3ca05dc5db0b8538205fe6015197af0cfaa453d7.tar.gz
Merge commit '999ff68a38729aaebe8b5b772b789b97dc145820'
* commit '999ff68a38729aaebe8b5b772b789b97dc145820': Squashed 'json/' changes from 69acf529..fd9bcfbd
Diffstat (limited to 'json')
-rw-r--r--json/remotes/nested/foo-ref-string.json6
-rw-r--r--json/remotes/nested/string.json3
-rw-r--r--json/tests/draft-next/refRemote.json25
-rw-r--r--json/tests/draft2019-09/refRemote.json25
-rw-r--r--json/tests/draft2020-12/refRemote.json25
-rw-r--r--json/tests/draft6/refRemote.json25
-rw-r--r--json/tests/draft7/refRemote.json25
7 files changed, 134 insertions, 0 deletions
diff --git a/json/remotes/nested/foo-ref-string.json b/json/remotes/nested/foo-ref-string.json
new file mode 100644
index 0000000..9cd2527
--- /dev/null
+++ b/json/remotes/nested/foo-ref-string.json
@@ -0,0 +1,6 @@
+{
+ "type": "object",
+ "properties": {
+ "foo": {"$ref": "string.json"}
+ }
+}
diff --git a/json/remotes/nested/string.json b/json/remotes/nested/string.json
new file mode 100644
index 0000000..c2d48c0
--- /dev/null
+++ b/json/remotes/nested/string.json
@@ -0,0 +1,3 @@
+{
+ "type": "string"
+}
diff --git a/json/tests/draft-next/refRemote.json b/json/tests/draft-next/refRemote.json
index 0a5e484..a844039 100644
--- a/json/tests/draft-next/refRemote.json
+++ b/json/tests/draft-next/refRemote.json
@@ -204,5 +204,30 @@
"valid": false
}
]
+ },
+ {
+ "description": "retrieved nested refs resolve relative to their URI not $id",
+ "schema": {
+ "$id": "http://localhost:1234/some-id",
+ "properties": {
+ "name": {"$ref": "nested/foo-ref-string.json"}
+ }
+ },
+ "tests": [
+ {
+ "description": "number is invalid",
+ "data": {
+ "name": {"foo": 1}
+ },
+ "valid": false
+ },
+ {
+ "description": "string is valid",
+ "data": {
+ "name": {"foo": "a"}
+ },
+ "valid": true
+ }
+ ]
}
]
diff --git a/json/tests/draft2019-09/refRemote.json b/json/tests/draft2019-09/refRemote.json
index 0a5e484..a844039 100644
--- a/json/tests/draft2019-09/refRemote.json
+++ b/json/tests/draft2019-09/refRemote.json
@@ -204,5 +204,30 @@
"valid": false
}
]
+ },
+ {
+ "description": "retrieved nested refs resolve relative to their URI not $id",
+ "schema": {
+ "$id": "http://localhost:1234/some-id",
+ "properties": {
+ "name": {"$ref": "nested/foo-ref-string.json"}
+ }
+ },
+ "tests": [
+ {
+ "description": "number is invalid",
+ "data": {
+ "name": {"foo": 1}
+ },
+ "valid": false
+ },
+ {
+ "description": "string is valid",
+ "data": {
+ "name": {"foo": "a"}
+ },
+ "valid": true
+ }
+ ]
}
]
diff --git a/json/tests/draft2020-12/refRemote.json b/json/tests/draft2020-12/refRemote.json
index 0a5e484..a844039 100644
--- a/json/tests/draft2020-12/refRemote.json
+++ b/json/tests/draft2020-12/refRemote.json
@@ -204,5 +204,30 @@
"valid": false
}
]
+ },
+ {
+ "description": "retrieved nested refs resolve relative to their URI not $id",
+ "schema": {
+ "$id": "http://localhost:1234/some-id",
+ "properties": {
+ "name": {"$ref": "nested/foo-ref-string.json"}
+ }
+ },
+ "tests": [
+ {
+ "description": "number is invalid",
+ "data": {
+ "name": {"foo": 1}
+ },
+ "valid": false
+ },
+ {
+ "description": "string is valid",
+ "data": {
+ "name": {"foo": "a"}
+ },
+ "valid": true
+ }
+ ]
}
]
diff --git a/json/tests/draft6/refRemote.json b/json/tests/draft6/refRemote.json
index 3b5a7fb..c2b2002 100644
--- a/json/tests/draft6/refRemote.json
+++ b/json/tests/draft6/refRemote.json
@@ -210,5 +210,30 @@
"valid": false
}
]
+ },
+ {
+ "description": "retrieved nested refs resolve relative to their URI not $id",
+ "schema": {
+ "$id": "http://localhost:1234/some-id",
+ "properties": {
+ "name": {"$ref": "nested/foo-ref-string.json"}
+ }
+ },
+ "tests": [
+ {
+ "description": "number is invalid",
+ "data": {
+ "name": {"foo": 1}
+ },
+ "valid": false
+ },
+ {
+ "description": "string is valid",
+ "data": {
+ "name": {"foo": "a"}
+ },
+ "valid": true
+ }
+ ]
}
]
diff --git a/json/tests/draft7/refRemote.json b/json/tests/draft7/refRemote.json
index 3b5a7fb..c2b2002 100644
--- a/json/tests/draft7/refRemote.json
+++ b/json/tests/draft7/refRemote.json
@@ -210,5 +210,30 @@
"valid": false
}
]
+ },
+ {
+ "description": "retrieved nested refs resolve relative to their URI not $id",
+ "schema": {
+ "$id": "http://localhost:1234/some-id",
+ "properties": {
+ "name": {"$ref": "nested/foo-ref-string.json"}
+ }
+ },
+ "tests": [
+ {
+ "description": "number is invalid",
+ "data": {
+ "name": {"foo": 1}
+ },
+ "valid": false
+ },
+ {
+ "description": "string is valid",
+ "data": {
+ "name": {"foo": "a"}
+ },
+ "valid": true
+ }
+ ]
}
]