diff --git a/tests/draft2019-09/id.json b/tests/draft2019-09/id.json index 3205c054..050c0c73 100644 --- a/tests/draft2019-09/id.json +++ b/tests/draft2019-09/id.json @@ -94,5 +94,45 @@ "valid": false } ] + }, + { + "description": "Valid use of empty fragments in location-independent $id", + "schema": { + "$ref": "https://json-schema.org/draft/2019-09/schema" + }, + "tests": [ + { + "description": "Identifier name with absolute URI", + "data": { + "$ref": "http://localhost:1234/bar", + "$defs": { + "A": { + "$id": "http://localhost:1234/bar#", + "type": "integer" + } + } + }, + "valid": true + }, + { + "description": "Identifier name with base URI change in subschema", + "data": { + "$id": "http://localhost:1234/root", + "$ref": "http://localhost:1234/nested.json#/$defs/B", + "$defs": { + "A": { + "$id": "nested.json", + "$defs": { + "B": { + "$id": "#", + "type": "integer" + } + } + } + } + }, + "valid": true + } + ] } ]