Skip to content

Commit 620fe34

Browse files
committed
[300] Add tests for valid use of empty fragments in "$id"
1 parent a37e8c9 commit 620fe34

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

tests/draft2019-09/id.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,5 +103,45 @@
103103
"valid": false
104104
}
105105
]
106+
},
107+
{
108+
"description": "Valid use of empty fragments in location-independent $id",
109+
"schema": {
110+
"$ref": "https://json-schema.org/draft/2019-09/schema"
111+
},
112+
"tests": [
113+
{
114+
"description": "Identifier name with absolute URI",
115+
"data": {
116+
"$ref": "http://localhost:1234/bar",
117+
"$defs": {
118+
"A": {
119+
"$id": "http://localhost:1234/bar#",
120+
"type": "integer"
121+
}
122+
}
123+
},
124+
"valid": true
125+
},
126+
{
127+
"description": "Identifier name with base URI change in subschema",
128+
"data": {
129+
"$id": "http://localhost:1234/root",
130+
"$ref": "http://localhost:1234/nested.json#/$defs/B",
131+
"$defs": {
132+
"A": {
133+
"$id": "nested.json",
134+
"$defs": {
135+
"B": {
136+
"$id": "#",
137+
"type": "integer"
138+
}
139+
}
140+
}
141+
}
142+
},
143+
"valid": true
144+
}
145+
]
106146
}
107147
]

0 commit comments

Comments
 (0)