-
-
Notifications
You must be signed in to change notification settings - Fork 216
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
Rename definitions to $defs in the 2019-06 draft. #266
Conversation
@Julian mostly we agreed that it should have a |
:D haha aright, makes sense. |
@@ -139,7 +135,7 @@ | |||
"$id": "http://localhost:1234/object", | |||
"type": "object", | |||
"properties": { | |||
"name": {"$ref": "name.json#/definitions/orNull"} | |||
"name": {"$ref": "name.json#/$defs/orNull"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may need a new /remotes/name.json:
{
"definitions": {
"orNull": {
"anyOf": [
{"type": "null"},
{"$ref": "#"}
]
}
},
"type": "string"
}
It has a definitions
that 3 of the tests try to reference into.
- refRemote
- root in remote ref
- null is valid
- object is invalid
- string is valid
- root in remote ref
This change updates the definitions
to a $defs
in the $ref
s causing the tests to (rightly) fail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't just change /remotes/name.json, though. We still need that for the other drafts. (I suppose you could add $defs
with a copy of what's in definitions
... ¯\_(ツ)_/¯ )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ech, yes that sounds annoying to fix...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually tried to add $defs
to name.json locally, but my implementation threw a fit because it couldn't determine which draft the schema was.
I have logic which analyzes the keywords to determine which drafts the schema conforms to if it's not specified explicitly by the $schema
keyword. Since I don't list definitions
as draft-8-compatible, having both it and $defs
in the same schema gives it a sad.
I understand that definitions
is included for backward compatibility, but I'm trying to dissuade people from using it by producing an error when it is used in a draft-8 schema.
In the end, I ended up creating a name-draft-8 file to get it passing locally.
There are also several places that refer to Interestingly, these places are causing
|
The canonical URI thing sounds like something @Relequestual / @handrews should have opinions on? Whatever we are choosing yeah should go there. |
We decided that meta-schema file names would follow DATE as opposed to draft numbers. This is covered in the core spec: https://json-schema.org/work-in-progress/WIP-jsonschema-core.html#rfc.section.7.5 (WIP URL will vanish, so here's the extract as of today.)
The date should be |
As per https://json-schema.org/work-in-progress/WIP-jsonschema-validation.html#rfc.appendix.C
Refs #265
Although :( at
I don't like "shorter to type" as a reason to do anything personally :/ but hey that's as usual on me to say when noticing that change. Oh well.
There's also a few places in the WIP that still say
definitions
. Will find wherever that should be filed.