Skip to content

Commit 130621c

Browse files
committed
Add unnormalized tests
1 parent ebec214 commit 130621c

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed

tests/draft2019-09/core/id.json

+58
Original file line numberDiff line numberDiff line change
@@ -144,5 +144,63 @@
144144
"valid": true
145145
}
146146
]
147+
},
148+
{
149+
"description": "Unnormalized $ids are allowed but discouraged",
150+
"schema": {
151+
"$ref": "https://json-schema.org/draft/2019-09/schema"
152+
},
153+
"tests": [
154+
{
155+
"description": "Unnormalized identifier",
156+
"data": {
157+
"$ref": "http://localhost:1234/foo/baz",
158+
"$defs": {
159+
"A": {
160+
"$id": "http://localhost:1234/foo/bar/../baz",
161+
"type": "integer"
162+
}
163+
}
164+
},
165+
"valid": true
166+
},
167+
{
168+
"description": "Unnormalized identifier no ref",
169+
"data": {
170+
"$defs": {
171+
"A": {
172+
"$id": "http://localhost:1234/foo/bar/../baz",
173+
"type": "integer"
174+
}
175+
}
176+
},
177+
"valid": true
178+
},
179+
{
180+
"description": "Unnormalized identifier with empty fragment",
181+
"data": {
182+
"$ref": "http://localhost:1234/foo/baz",
183+
"$defs": {
184+
"A": {
185+
"$id": "http://localhost:1234/foo/bar/../baz#",
186+
"type": "integer"
187+
}
188+
}
189+
},
190+
"valid": true
191+
},
192+
{
193+
"description": "Unnormalized identifier with empty fragment no ref",
194+
"data": {
195+
"$defs": {
196+
"A": {
197+
"$id": "http://localhost:1234/foo/bar/../baz#",
198+
"type": "integer"
199+
}
200+
}
201+
},
202+
"valid": true
203+
}
204+
]
147205
}
148206
]

0 commit comments

Comments
 (0)