From cf886386cc0996df6743b425f74675a6d8a1a9ca Mon Sep 17 00:00:00 2001 From: Julian Berman Date: Thu, 7 Oct 2021 09:13:10 -0400 Subject: Squashed 'json/' changes from 20c1bb1d9..54440eab4 54440eab4 Merge pull request #516 from ChALkeR/chalker/ipv6 e7b22e1c6 Fix the sanity check by pinning. 8891d8107 Merge pull request #519 from json-schema-org/ether/custom-dialect 5f5fccda3 test the format-assertion vocabulary with a custom metaschema 3fcee3868 Merge pull request #512 from json-schema-org/ether/formats-and-non-strings b349b8797 test that format-assertions are valid with non-string types 8e5b2f10d fix needless inconsistencies in format tests between drafts 02d7cb59a Correct "ref with sibling id" tests 1649470ba More ipv6 tests to increase coverage 7334b4c7e Merge pull request #505 from ChALkeR/chalker/fix-unicode 0fb2d2787 Consolidate optional/unicode into optional/ecmascript-regex 4f8c6d7bf unevaluatedProperties: deep dynamic + refs 9103f3b6f $ref wit id does not test what it is indented to do f300dd15f Add test "same $anchor with different base uri" d128f9d7f Add test to check that $id resolved against nearest parent, not just immediate parent 72e31dd20 Merge pull request #515 from json-schema-org/ether/fix-mandatory-format-tests 0173a0835 Revert "by default, "format" only annotates, not validates" 66e813a90 Merge pull request #506 from json-schema-org/ether/formats-non-ascii 9430972bc fix unicode tests in accordance to pattern/patternProperties spec git-subtree-dir: json git-subtree-split: 54440eab4d50b80a62cc9f9c561e306cdbb19591 --- tests/draft-future/anchor.json | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'tests/draft-future/anchor.json') 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 + } + ] } ] -- cgit v1.2.1