-
-
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!: extend bundling to create another schemas without $id #298
Conversation
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 small suggestions.
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 👍
So my thoughts the current $id
and $ref
situation is that we have solved the issue in the bundled schemas now, which is perfect 👌
If however, people want to use a single schema, instead of the bundled one, we still support dynamically fetching those schemas remotely. Which I technically think is good, whether there is a use-case for it is another thing 😆 Cause I don't see it, just from a technical standpoint.
So if we don't see that as a "thing", we could remove the $id
yea, but I would probably wait and see tbh 🙂
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.
Two suggestions :)
I would leave it at that, even if we currently have no use case for that. |
Co-authored-by: Fran Méndez <[email protected]> Co-authored-by: Maciej Urbańczyk <[email protected]>
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
@magicmatatjahu @jonaslagoni the problem is that once I leave
because
what do you mean by single schema? like https://github.com/asyncapi/spec-json-schemas/blob/master/definitions/2.5.0/channels.json ? the $ref that we use there is absolute so I guess omg I don't think I will ever like |
@derberg yea you're right, forgot that the Thought you meant to remove them from the individual definitions. |
Actually, why not? I seriously do not get why we need it there 😆 {
"type": "object",
"propertyNames": {
"type": "string",
"format": "uri-template",
"minLength": 1
},
"additionalProperties": {
"$ref": "http://asyncapi.com/definitions/2.5.0/channelItem.json"
},
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://asyncapi.com/definitions/2.5.0/channels.json"
} if |
If the schema is single, the EDIT: That |
There are three concepts in play:
Exactly. It's only RECOMMENDED practice to use |
@char0n thanks a lot for detailed explanation
now looking at my example above, reference points to http://asyncapi.com/definitions/2.5.0/channelItem.json where ... ok, I leave |
@derberg any update here, or are you just waiting for reviews? 🙂 |
ok, so now but in Parser it fails with:
but....but there is no I thought I need I ran out of ideas, need a break |
@jonaslagoni @smoya I changed the package exports, have a look:
|
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.
If you dont want 2 major version changes within 3 months, you could merge this into next-major-spec
. But just a suggestion 🙂
I do not mind having major every month if that is required 😃 we should not be afraid of major releases in libraries |
I agree. And keep advocating for that over long living PR's targeting |
I'm sure releasing few many major versions in a short period of time can be taken as negative because few reasons. Completely valid for a new discussion but still worth to share IMHO:
Having said that, its up to you to do one thing or another atm |
We have March now, releasing major. Next maybe, I say maybe, will be in June. So we have at least 3 months different. This is not often. Let us not forget it is not a big project. This is super simple package, that only exposes json files, not parser or any complicated beast.
have you ever "rejected" to use a package that has many major releases?
anyway, thanks for approval 🙏🏼 😄 |
1 similar comment
@smoya please approve again, I had to solve merge conflict with readme cause by new breaking changes section. No more changes |
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
/rtm |
🎉 This PR is included in version 4.3.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
⏰ BREAKING CHANGE ⏰
@asyncapi/specs
package has now different structure. You no longer access specs directly by version name but there are 2 properties:schemas
- with previous schemas objectschemasWithoutIds
- with new set of schemas that do not contain$id
For more details check out readme updates about
$id
and examples on how to use the packageFixes #247
Fixes #367
This is a workaround implementation. I'm not proud of it but it is better than the current situation.
Our AsyncAPI JSON Schema is created following JSON Schema best practices and also requirements of https://github.com/hyperjump-io/json-schema-bundle - which means we have beautiful
$id
and our references are based on these, which makes schema unreadable for humans (like me that completely do not understand$id
and$ref
concept, but my issues could be ignored and I could learn) and are not understood by some tools (like https://github.com/redhat-developer/vscode-yaml that VSCode YAML autocompletion and validation is based on, and this is a problem for us).schemas
dir, that are alternative, without $id