-
-
Notifications
You must be signed in to change notification settings - Fork 280
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
Support JSON Schema Draft 2020-12 #596
Comments
A thought: |
@Relequestual I think we'll need your help with dialects 😊 Mind joining our next SIG meeting and giving us an introduction/demo? |
@fmvilas Sorry for not seeing this. I rarely get round to seeing GitHub notifications. When processing a JSON Schema, an implementation must look at any defined In order to determine if you can process a document, you must know the defined dialect, and be able to match that to a meta-schema. Let me know if any of that doesn't make sense. |
@Relequestual Yeah, I understand that, user can choose which version of JSON Schema can use by |
Great! Just wanted to share as @fmvilas said you needed help with dialects. I guess that's outdated? |
@Relequestual Could we use "allOf": [
{
"$ref": "https://asyncapi.com/220-schema",
"$ref": "https://asyncapi.com/json-schemadraft-7-vocabulary",
}
], |
@smoya You can use any "dialect" that is known. Are you extending the draft-07 dialect/vocabulary with your own keywords? If I understand correctly, we could look into providing those vocabulary URIs, but how far back should we go? draft-04? We want to encourage people to move to newer versions. |
There is a potential blocker that may stop us to move forward from Meaning some of We should either look for an alternative, work on such linked issue or craft a solution ourselves. EDIT: Related issue: asyncapi/parser-js#404 |
I was chatting with @jonaslagoni in slack and he suggested me to leave a comment here. I would like to see the upgrade as well, not sure I can contribute much practically (don't know json schema that deeply, don't know js much either), so consider this more like an end user desire, but draft 7 is pretty old now and new people (like me) to json schema would probably start with newer drafts. Also, I think OpenAPI 3.1 is backed by json schema 2020, so it would make sense to upgrade there |
My only concern is the state of the tooling support for the newer versions of JSON Schema. The last time I checked, it wasn't widely supported. If tooling is not there yet, I'd not upgrade either. There's no point in upgrading to the latest version if fewer people will be able to use it. |
If we stay, there are still some features from JSON Schema Draft 2019-09 and greater that we could port, such as the reference and bundling behavior. Tooling would need to be maintained in our side but maybe it is worth the movement. More on #649 |
I honestly doubt it but I don't have the data, it's just a gut feeling. I think most people are not using complex JSON Schemas on AsyncAPI. But again, just a gut feeling. |
Yeah, I think so as well. In fact, the only needed (at a glance) feature was having the possibility to override properties when using For example, and this is the most unsuitable thing IMHO, is the fact that properties to override will do a
We (@jonaslagoni and I) couldn't find an official doc place where they mention this, however you can find some mentions on this library issue APIDevTools/json-schema-ref-parser#145 (comment) (from where I got the example above) and also this Slack thread where @jonaslagoni is involved https://json-schema.slack.com/archives/CT8QRGTK5/p1637146426080000?thread_ts=1636976501.051400&cid=CT8QRGTK5 Meaning #649 is potentially gonna be closed as won't do if we decide indeed the new More to come on other issues. |
This issue has been automatically marked as stale because it has not had recent activity 😴 It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation. There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model. Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here. Thank you for your patience ❤️ |
|
Currently in the
2.1.0
version of spec, we support only JSON Schema in the version of draft 07. There are some changes (including breaking changes) betweendraft 07
->draft 2019-09
->draft 2020-12
, especially with core keywords:dependencies
are split todependentSchemas
anddependentRequired
- as I readdependencies
has still backward compatibilitydeprecated
keyword - similar to ourdeprecated
unevaluatedItems
andunevaluatedProperties
keywords - similar toadditional*
, but they can "see" into subschemas and across referencesminContains
,maxContains
definitions
->$def
(definitions
has still backward compatibility)$ref
other keywords are now allowed alongside of itYou can read all changes in:
Due to the fact that JSON Schema itself has breaking change and it's treated by us as a base for our Schema Object, so the specification itself will have breaking change when we start supporting the latest drafts.
The issue itself is like question: When will we start supporting this? O maybe someone have an opinion that we shouldn't support this at all in the near future? Or if yes, when? In
3.0.0
or4.0.0
?We must also remember about adjusting the JSON Schema for spec to the
Draft 2020-12
.The text was updated successfully, but these errors were encountered: