Skip to content

Commit 07b2cf5

Browse files
committed
[300] Add tests for valid use of empty fragments in "$id"
1 parent 3ac20c9 commit 07b2cf5

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

tests/draft2019-09/ref.json

+40
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,46 @@
454454
}
455455
]
456456
},
457+
{
458+
"description": "Valid use of empty fragments in location-independent $id",
459+
"schema": {
460+
"$ref": "https://json-schema.org/draft/2019-09/schema"
461+
},
462+
"tests": [
463+
{
464+
"description": "Identifier name with absolute URI",
465+
"data": {
466+
"$ref": "http://localhost:1234/bar",
467+
"$defs": {
468+
"A": {
469+
"$id": "http://localhost:1234/bar#",
470+
"type": "integer"
471+
}
472+
}
473+
},
474+
"valid": true
475+
},
476+
{
477+
"description": "Identifier name with base URI change in subschema",
478+
"data": {
479+
"$id": "http://localhost:1234/root",
480+
"$ref": "http://localhost:1234/nested.json#/$defs/B",
481+
"$defs": {
482+
"A": {
483+
"$id": "nested.json",
484+
"$defs": {
485+
"B": {
486+
"$id": "#",
487+
"type": "integer"
488+
}
489+
}
490+
}
491+
}
492+
},
493+
"valid": true
494+
}
495+
]
496+
},
457497
{
458498
"description": "ref creates new scope when adjacent to keywords",
459499
"schema": {

0 commit comments

Comments
 (0)