Skip to content

Commit

Permalink
Add unnormalized $id tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ssilverman committed May 31, 2020
1 parent 9f54842 commit af3c370
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions tests/draft2019-09/id.json
Original file line number Diff line number Diff line change
Expand Up @@ -144,5 +144,63 @@
"valid": true
}
]
},
{
"description": "Unnormalized $ids are allowed but discouraged",
"schema": {
"$ref": "https://json-schema.org/draft/2019-09/schema"
},
"tests": [
{
"description": "Unnormalized identifier",
"data": {
"$ref": "http://localhost:1234/foo/baz",
"$defs": {
"A": {
"$id": "http://localhost:1234/foo/bar/../baz",
"type": "integer"
}
}
},
"valid": true
},
{
"description": "Unnormalized identifier and no ref",
"data": {
"$defs": {
"A": {
"$id": "http://localhost:1234/foo/bar/../baz",
"type": "integer"
}
}
},
"valid": true
},
{
"description": "Unnormalized identifier with empty fragment",
"data": {
"$ref": "http://localhost:1234/foo/baz",
"$defs": {
"A": {
"$id": "http://localhost:1234/foo/bar/../baz#",
"type": "integer"
}
}
},
"valid": true
},
{
"description": "Unnormalized identifier with empty fragment and no ref",
"data": {
"$defs": {
"A": {
"$id": "http://localhost:1234/foo/bar/../baz#",
"type": "integer"
}
}
},
"valid": true
}
]
}
]

0 comments on commit af3c370

Please sign in to comment.