Skip to content

Commit

Permalink
Add tests for non-relative URI anchor referencing
Browse files Browse the repository at this point in the history
  • Loading branch information
jdesrosiers committed May 29, 2023
1 parent 7950d9e commit b069ac3
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
27 changes: 27 additions & 0 deletions tests/draft6/ref.json
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,33 @@
}
]
},
{
"description": "Reference an anchor with a non-relative URI",
"schema": {
"$id": "https://example.com/schema-with-anchor",
"allOf": [{
"$ref": "https://example.com/schema-with-anchor#foo"
}],
"definitions": {
"A": {
"$id": "#foo",
"type": "integer"
}
}
},
"tests": [
{
"data": 1,
"description": "match",
"valid": true
},
{
"data": "a",
"description": "mismatch",
"valid": false
}
]
},
{
"description": "Location-independent identifier with base URI change in subschema",
"schema": {
Expand Down
27 changes: 27 additions & 0 deletions tests/draft7/ref.json
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,33 @@
}
]
},
{
"description": "Reference an anchor with a non-relative URI",
"schema": {
"$id": "https://example.com/schema-with-anchor",
"allOf": [{
"$ref": "https://example.com/schema-with-anchor#foo"
}],
"definitions": {
"A": {
"$id": "#foo",
"type": "integer"
}
}
},
"tests": [
{
"data": 1,
"description": "match",
"valid": true
},
{
"data": "a",
"description": "mismatch",
"valid": false
}
]
},
{
"description": "Location-independent identifier with base URI change in subschema",
"schema": {
Expand Down

0 comments on commit b069ac3

Please sign in to comment.