Skip to content

Commit

Permalink
[300] Add tests for valid use of empty fragments in "$id"
Browse files Browse the repository at this point in the history
  • Loading branch information
ssilverman committed Apr 29, 2020
1 parent c042465 commit f492315
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions tests/draft2019-09/ref.json
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,46 @@
}
]
},
{
"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
}
]
},
{
"description": "ref creates new scope when adjacent to keywords",
"schema": {
Expand Down

0 comments on commit f492315

Please sign in to comment.