-
-
Notifications
You must be signed in to change notification settings - Fork 54
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
feat: add binding validation #239
feat: add binding validation #239
Conversation
Before converting all the bindings to this exact setup, I think we need to agree on the approach beforehand. Tagging code owners and known interested parties: @fmvilas @smoya @derberg @dalelane @magicmatatjahu |
We considered this setup back then and ditched this idea because it allows having more than one version of a single binding, which is weird. However, since you're using Referencing asyncapi/bindings#62 because it's related. |
+1 to this. A quick clarification, something we should have in mind from now on: With this approach, the only hard requirement is that JSON Schemas for bindings should contain As a side note, maybe, we could do a similar script as you @jonaslagoni did for creating a new JSON Schema file for new AsyncAPI spec version but for creating a new binding or a new version of a binding. This could go into a new issue/feature request. |
This looks so simple 😄 I waited few day with review as I was afraid of the complexity...that is not here. Clean 💪🏼 |
We default to the latest binding version if nothing is specified.
We should definitely do that yes 🙂 |
That could potentially break documents if a new major version of the binding is released. Documents that were working with binding |
Yea you are right, might need to redefine that behavior when introducing this. |
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.
looks like a good idea to me 👍
# Conflicts: # package-lock.json
Kudos, SonarCloud Quality Gate passed! |
Alright adapted all the bindings and other changes. Here are the changes I made:
This PR is ready to be reviewed and merged 🙂 |
why it targets |
I actually did not count on integrating the bindings for version 2, which is why I targeted The only reason for this is to err on caution, as we are removing a schema |
@jonaslagoni sorry, I mean that we do not need to wait for 3.0 as we can just release |
I know er can do it, but as i said, I did not plan to backtrack this to AsyncAPI 2.x, that said its definitely possible, using the same setup as here. Are you implying that is what we should do? Or? 😃 |
yeah, kinda 😄
but I'm definitely not planning to die on that hill if others don't share my opinion 😃 |
Alright so here are the options:
@fmvilas @dalelane @derberg those are your possibilities in short 😅 Let me know what you would like to do, I have no strong feelings either other then option 1 is the easiest from my point of view 😆 |
I also see more value in releasing this sooner rather than waiting for 3.0. +1 to @derberg 's reasoning. It provides a lot of value. |
Yeah, don't have a strong opinion either but Lukasz's point makes sense. |
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.
sooner sounds good to me too 👍
I have updated the PR with the latest changes on next and added the new pulsar bindings, should be ready for final review ✌️ |
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.
👍
just to clarify the previous discussion. So the final decision is to put it in 3.0 and not sooner? |
Tbh... I just don't want to spend the time splitting up the PR into one for |
We can merge this and backtrack it to |
And we still dont know what to do about the specification extension, as it's currently explicitly linked to spec 3.0 in each binding version. So it's not as easy as saying "let's do it", problems will arise when we try to backport it. Of course, it's something we still have to figure out for the next version anyway, but at least it's not right now that will further delay it. But in the end it's up to you 🤷 |
I do not have super hard feelings about it. So yeah, let's just merged it for 3.0 only for now |
@derberg I will let you folks decide when adequate enough time has passed for reviewers to respond and for merge it. |
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.
LGTM 👍
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.
🚀🌔 LGTM!
@char0n we are just missing your approval |
So yea |
/rtm |
🎉 This PR is included in version 5.0.0-next-major-spec.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Great work here! 🎉 Regarding AsyncAPI 2.x.y - I'm assuming that every binding version that is available is allowed to be used for any AsyncAPI 2.x.y version right? Or do we have somewhere the matching map of which binding versions is allowed for what AsyncAPI 2.x.y spec? |
@char0n yea there is still no consensus or progress in the discussion regarding that, as the spec 3.0 changes need to be done first before figuring out what to do about the compatibility between versions of bindings: asyncapi/bindings#182 |
🎉 This PR is included in version 6.0.0-next-major-spec.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Description
This PR is a suggestion on how to handle binding versions as well as integrate them into the specification.
Binding versioning
Each binding should now be located as the following folder structure for the json-schema files:
The binding
$id
s will now contain the accurate version, so instead of"$id": "http://asyncapi.com/bindings/amqp/channel.json"
it will have"$id": "http://asyncapi.com/bindings/amqp/0.2.0/channel.json"
.This setup will allow us to work on bindings alongside the spec itself, and continuously release new binding versions.
Integrating with spec
One of the core issues with bindings is that some binding versions might only fit together with specific versions of the spec. To allow for this finetuned control, we can now reference the binding versions exactly as they are compatible and leave out versions when necessary:
Related issues
Related to asyncapi/spec#590
Related to asyncapi/parser-js#315
Related to asyncapi/bindings#113
Blocked by #289