-
-
Notifications
You must be signed in to change notification settings - Fork 215
Add tests for reference-to-unknown to earlier drafts #348
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
Comments
I have to look back at history, but my quick recollection is this is actually new in 2019-09. I think previous drafts actually required this behavior (and that there are tests already ensuring it's followed) But I'm not 100% positive, I remember some recent discussion about it -- maybe hunting down the commit that added this to 2019-09 is a good first step? |
Turns out I don't fully understand this yet. I found this: json-schema-org/json-schema-spec#713, the bug it's fixing (json-schema-org/json-schema-spec#687), and other things that refer to it. [duplicate comment to one I added to #349] |
Those definitely look like the relevant discussions yep. |
Yes, this was added in 2019-09. The pathological case is this (where $id: https://example.com/schemas/foo
properties:
thing: {$ref: "#/singleSubschemaDefinition/singleSubschemaDefinition"}
singleSubschemaDefinition:
$id: bar/baz # resolves to https://example.com/bar/baz
singleSubschemaDefinition:
$id: stuff # resolves to https://example.com/bar/stuff
$ref: zippy # resolves to https://example.com/bar/zippy The problem here is that the JSON Pointer-based So in 2019-09 and later, we allow implementations to refuse to resolve However, in draft-07 and earlier, there is nothing that allows refusing to resolve a JSON Pointer-based URI where you understand the non-fragment part. Here is the relevant langauge:
There is nothing that discusses how an implementation can tell if a given URI identifies a schema, so the reasonable assumption is that if the location exists and is an object or boolean, it is treated as a schema. Because there's nothing that automatically disqualifies an object from being a schema. So I agree with @Julian here, this issue can be closed as this test should not be backported earlier than 2019-09. |
Gonna go with that, closing, thanks! |
Only Draft 2019-09 has these tests, in
optional/refOfUnknownKeyword.json
. This issue tracks adding them to the earlier draft tests, all the way back to draft-03.The text was updated successfully, but these errors were encountered: