-
-
Notifications
You must be signed in to change notification settings - Fork 96
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 name and summary properties to message examples #307
feat: add name and summary properties to message examples #307
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.
Welcome to AsyncAPI. Thanks a lot for creating your first pull request. Please check out our contributors guide and the instructions about a basic recommended setup useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.
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.
@lbroudoux hey, you created a PR against master but it should be the release branch. I changed it but I think you create a branch from master and now PR shows other files too. Can you just remove irrelevant parts from that PR?
update bundle to reflect latest version of the file from release branch
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.
Implementation is fine but the problem is that this PR introduces a breaking change, examples
returns an array of MessageExample instead of an array of any so things like this will start failing. I don't think we can add MessageExample
model 🤔 thoughts?
another pair of 👀 ? @fmvilas @jonaslagoni
Also would be great to have a test case for example with name or summary without payload, to test the new dependencies
keyword from the json schema.
as for the bundle, it needs to stay in the PR, I tried to help here, and made sure it is unchanged but it is still showing up 🤷🏼
I don't get it. How is this failing if we're just adding |
@fmvilas problem is we are changing the return type from |
@fmvilas sorry for picking wrong words, I actually assumed you will look into the code and read my entire comment 😛 |
My short answer is I think we should trigger a major release because of this change. |
@jonaslagoni this part I'm not sure, this is why I called you out. The example object already had 2 properties, |
Does not change the fact that we alter the structure of the return type, we change it from a property -> function. Which is a breaking change. If we want to leave out the model then sure, we could avoid it, but it would be a strange behavior compared to the rest of the implementation. Just to avoid major version change. |
Still confused 🤔 I think this is a breaking change on the parser model not on the spec. The fact that |
We can treat it as normal JS object, as previous, not as new
@derberg Don't worry, I will fix it as fast as I can, when we will go with breaking change 😘 |
oh, where did I write it is a spec breaking change? It is a PR to parser, and I mean it is breaking change for the parser. Wanted your opinion to validate if I'm right that don't have to go with
that's the point, we should not change return type |
So you want to create a solution that we wouldn't normally do, just to avoid a major version change? Cause not doing this with models will create a weird behavior/structure. |
the current implementation is:
And examples are already a well-described array of objects, with So basically in my opinion this PR doesn't have to solve the old error and introduce a model. This PR is related to change in the spec that adds new props to
so we are not creating anything new here. Lack of the model for examples can and should be done later in a separate Pr independent from the 2.1 release flow. This is how I see it. |
Riiight, I see your point yea, then I agree, it should not introduce the model 🙂 |
@lbroudoux I think the conclusion from this discussion is clear. Please do not introduce |
@derberg I carefully followed the thread yesterday as I'm not a JS expert ;-) I did not have the full history of the component nor the constraints you put on it. However I was wondering why we couldn't have a breaking change in parser implementation - even if this is not a breaking change in spec. Parser version is not indexed on spec version so we could have version bump here for supporting 2.1 of spec. Anyway, as you suggested I'm gonna create an issue referring the commit for |
I may also rename this PR as it will no longer provide formal type but just ensure untyped object attributes are there. |
not sure what perspective others have. My perspective is, we do not yet properly test all the generator templates, but on the other hand, we have a mechanism that automatically bumps Parser in all the packages that use it, so this major release would trigger releases of all AsyncAPI tools and next days after the release we would do the firefighting. So I'm just pragmatic here and prefer to do a |
Yeah. Totally agree on the pragmatic approach to avoid firefighting 😉 What's why without having the full context in mind as you have I cannot take part of the decision process. I've already created the issue #321 to keep trace on this and will remove type from the PR asap. |
@lbroudoux no worries mate. |
I've added some tests locally using the spec from |
Tests have been completed to check the either / or requirement rule on |
@lbroudoux you know you didn't push anything right? |
Yes it was just a notice. I'll keep changes locally until the release candidate is ready as you suggested. |
…ements rules on example properties
@derberg Now updated! |
@lbroudoux code-wise - perfecto! Just please fix the failing linter, remove this single |
Dammit! I forgot a last npm lint... |
@lbroudoux and don't forget to change the PR title, same as on other PRs in other repos would be best |
Kudos, SonarCloud Quality Gate passed! |
Yep. Now done. All PRs now relates to adding name and summary properties to message examples. |
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! 🚀
🎉 This PR is included in version 1.6.0-2021-06-release.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Description
name
andsummary
attributesRelated issue(s)
This realizes to asyncapi/spec#329
New attributes are defined in asyncapi/spec#534
New schema implementation is in asyncapi/spec-json-schemas#54