summaryrefslogtreecommitdiff
path: root/tests/draft2019-09/ref.json
diff options
context:
space:
mode:
Diffstat (limited to 'tests/draft2019-09/ref.json')
-rw-r--r--tests/draft2019-09/ref.json36
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/draft2019-09/ref.json b/tests/draft2019-09/ref.json
index 4cb7bcd..fd8a3b2 100644
--- a/tests/draft2019-09/ref.json
+++ b/tests/draft2019-09/ref.json
@@ -539,5 +539,41 @@
"valid": true
}
]
+ },
+ {
+ "description": "$id must be resolved against nearest parent, not just immediate parent",
+ "schema": {
+ "$id": "http://example.com/a.json",
+ "$defs": {
+ "x": {
+ "$id": "http://example.com/b/c.json",
+ "not": {
+ "$defs": {
+ "y": {
+ "$id": "d.json",
+ "type": "number"
+ }
+ }
+ }
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "http://example.com/b/d.json"
+ }
+ ]
+ },
+ "tests": [
+ {
+ "description": "number should pass",
+ "data": 1,
+ "valid": true
+ },
+ {
+ "description": "non-number should fail",
+ "data": "a",
+ "valid": false
+ }
+ ]
}
]