-
Notifications
You must be signed in to change notification settings - Fork 63
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
New JSON Schema Version will ban unknown words #2072
Comments
I'd accept we cannot use jsonschema anymore, we already will have to deal with it not able to describe formats like cbor or msgpack already. |
Some thoughts:
|
Definitely :) I do not see a pressure to move to the new ones. Might be something for TD 3.0 even.
I am talking with @gregsdennis on JSON Schema Slack.
That stays but it won't help us exactly. We have issues in the schema definition level and not in the key definitions level. Our |
It's important to note (and I didn't in the blog post because it would have been confusing) that implementations can still support custom keywords. You're not limited to just the keywords defined by the spec. The language in the WIP spec is here. Basically, the requirement is based on whether the implementation understands the keyword. If not, then the implementation MUST NOT process the schema. So if you can register a custom keyword that does what you want (or nothing), then you're all good. Also, there's nothing stopping an implementation from having a configuration setting that allows unknown keywords; but that MUST NOT be the default behavior. This means that you'll need to get whatever implementations you use to support what you need. |
@gregsdennis wrote:
What does "registering a custom keyword" involve? Note that Wrapping the JSON Schema of a |
This will be different per implementation. Here are my docs for JsonSchema.Net: https://docs.json-everything.net/schema/vocabs/#schema-vocabs-custom-keywords |
After reading https://json-schema.org/blog/posts/stable-json-schema and the linked architectural design record at https://github.com/json-schema-org/json-schema-spec/blob/main/adr/2023-04-sva-prefix.md , we will have to consider using newer JSON Schema versions. Basically, any keyword that is not defined by JSON Schema standard MUST be prefixed with
x-
. This is a problem in two levels:forms
would not be allowed. We can avoid this by putting property data schema into adata
keyword@type
,prefix:myword
or other such terms will not be allowed in JSON Schema libraries. The only way around it is to require a "cleaning" step before the current TD scope is passed to a JSON Schema validator. Maybe there would be some libraries that can help with this but we may need to formally specify this.The text was updated successfully, but these errors were encountered: