diff options
Diffstat (limited to 'tests/draft2020-12/anchor.json')
-rw-r--r-- | tests/draft2020-12/anchor.json | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/draft2020-12/anchor.json b/tests/draft2020-12/anchor.json index 045cdc3..416c224 100644 --- a/tests/draft2020-12/anchor.json +++ b/tests/draft2020-12/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 + } + ] } ] |