-
-
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 extensions from extensions catalog to schema #443
feat: add extensions from extensions catalog to schema #443
Conversation
Signed-off-by: Sambhav Gupta <[email protected]>
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
…n-schemas into extensions Signed-off-by: Sambhav Gupta <[email protected]>
Quality Gate passedKudos, no new issues were introduced! 0 New issues |
@sambhavgupta0705 can you please link the issue related with this PR so people can know about it? Thanks! |
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 opened a PR to your fork with enhancements. It was more complex than I thought and in depts knowledge of JSON Schema was needed.
Before you merge my PR into your fork (that will automatically update this PR):
- please familiarize with changes in bundler script. They were necessary if we are about to treat extensions the same as bindings
- info schema is not an
allOf
because I believe best practice is already defined by bindings, where bindings have separate definition schema that accommodates all bindings for a given keyword. So this is why I suggestinfoExtensions.json
that will be responsible to keep a list of allinfo
extensions, so we do not "pollute" the maininfo
schema.
so yeah, proposal is that whenever there is a new extension in the catalog, for any part of the AsyncAPI document, like server
or operations
or whatever - extension should never be added inside the operations
but operations
should be modified into allOf and there needs to be a new operationsExtensions.json
created and new schema of new extension must be listed there.
Your job now is to now add to README a section where you explain a requirement on how extension schema should be added to the repo:
- where to put extensions:
- what folder
- what versioning means
- extension name in folder structure
- schema always in file called
schema.json
- that there needs to be a corresponding
definition
that relates to AsyncAPI object, likeinfo
and that it must haveExtensions
suffix. Basically point in readme tox-x
as example
extensions/0.1.0/x.json
Outdated
@@ -0,0 +1,15 @@ | |||
{ |
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.
the structure must change a bit, as you noticed, we initially forgot about versioning, so good you added it, but there is one more thing - each extension like in case of bindings have be independently released so:
extensions/x/0.1.0/schema.json
- this is the path we should have, folder with extension name and then version and each version has given version of the schema - this is why we can have always one filename as well - schema.json
@sambhavgupta0705 one more thing, changes that I propose in my PR, I tested them locally after bundling schema, converting test yaml file from repo to v3 and adding below:
|
chore: adjustments
can you please explain this a little more whenever you get time @derberg |
@sambhavgupta0705 I mean that this is how I tested to make sure my changes produce a schema that is a valid schema please also extend this PR by adding https://github.com/asyncapi/cli/blob/master/.sonarcloud.properties file, and making sure that whatever is in |
@sambhavgupta0705 ready for final review? |
@derberg yes it is |
Co-authored-by: Lukasz Gornicki <[email protected]>
Co-authored-by: Lukasz Gornicki <[email protected]>
Co-authored-by: Lukasz Gornicki <[email protected]>
Co-authored-by: Lukasz Gornicki <[email protected]>
Done @derberg 🚀 |
Quality Gate passedIssues Measures |
@dalelane @char0n @fmvilas @smoya please have a look at this one - it introduces a way of adding schemas of extensions into official json schema of course not just any random extension can be added here, but only extensions that are contributed to https://github.com/asyncapi/extensions-catalog. This should encourage community to share extensions. and yeah, unfortunate is that the first extension we have is from old times when Twitter was Twitter, so the new extension is called |
/rtm |
🎉 This PR is included in version 6.0.0-next-major-spec.17 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This PR is part of asyncapi mentorship program
related issue: #280