summaryrefslogtreecommitdiff
path: root/tests/draft-future/anchor.json
diff options
context:
space:
mode:
Diffstat (limited to 'tests/draft-future/anchor.json')
-rw-r--r--tests/draft-future/anchor.json35
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/draft-future/anchor.json b/tests/draft-future/anchor.json
index 045cdc3..416c224 100644
--- a/tests/draft-future/anchor.json
+++ b/tests/draft-future/anchor.json
@@ -134,5 +134,40 @@
"valid": false
}
]
+ },
+ {
+ "description": "same $anchor with different base uri",
+ "schema": {
+ "$id": "http://localhost:1234/foobar",
+ "$defs": {
+ "A": {
+ "$id": "child1",
+ "allOf": [
+ {
+ "$id": "child2",
+ "$anchor": "my_anchor",
+ "type": "number"
+ },
+ {
+ "$anchor": "my_anchor",
+ "type": "string"
+ }
+ ]
+ }
+ },
+ "$ref": "child1#my_anchor"
+ },
+ "tests": [
+ {
+ "description": "$ref should resolve to /$defs/A/allOf/1",
+ "data": "a",
+ "valid": true
+ },
+ {
+ "description": "$ref should not resolve to /$defs/A/allOf/0",
+ "data": 1,
+ "valid": false
+ }
+ ]
}
]