-
-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test for valid use of empty fragment in "$id" #300
Comments
I don't think either of these test cases ended up being covered by the final version of #341 (but the first one might be covered elsewhere). |
Both of these cases are implemented. However, I don't remember why {
"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
} The problem here is that this identifies both @Julian would you be OK with me making a PR to delete that case across all relevant drafts? If there's a way to set an external base URI I can replace it with the document root one, but otherwise this is more-or-less equivalent to having two identical |
If the test is wrong yes definitely a PR to remove would be appreciated! We have a way to communicate retrieval URIs, it's basically by putting the remote at a corresponding path inside But yeah I think it sounds like that should work for this scenario? |
@Julian sounds good, I'll make a PR for that. The test as it stands runs afoul of §9.1.2 "Loading a referenced schema" (last paragraph):
(I've filed json-schema-org/json-schema-spec#1271 to consolidate this and §8.1.2 which I linked in the comments, since one of them has a MAY around raising an error and the other a SHOULD). So it's not wrong to pass that test as written, but it would be equally correct to fail (resolving Unless the test suite can test for error conditions, in which case we could make that an optional test for raising an error, it should just be removed. |
$id
with trailing empty fragment equivalent to$id
without a fragment"$id": "#"
is a no-opThe text was updated successfully, but these errors were encountered: