-
-
Notifications
You must be signed in to change notification settings - Fork 98
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
"messageId" must be unique across all the messages. #793
Comments
Welcome to AsyncAPI. Thanks a lot for reporting your first issue. Please check out our contributors guide and the instructions about a basic recommended setup useful for opening a pull request. |
@wiegell |
@derberg I use it because the validator gives a warning if it's not specified. Since it is the exact same type of message i'm publishing and subscribing to, it seems reasonable to me that the id could be the same. |
I guess you're referring to https://github.com/WaleedAshraf/asyncapi-validator ? you do not have to use |
I mean the asyncapi cli validate command. |
ah, you mean the warnings that show up after AsyncAPI document is validated. actually I would question that missing I'll transfer this issue to parser repo as in the end it is parser related, not spec itself |
Welcome to AsyncAPI. Thanks a lot for reporting your first issue. Please check out our contributors guide and the instructions about a basic recommended setup useful for opening a pull request. |
|
Because spectral rules have been set up to do so 🤷 If you need more information I gotta tag @magicmatatjahu in 😄
Yep, it's a bug. |
Yes, missed |
But that's not possible with the current dereferencing strategy, isn't it? Spectral resolves references and then validate. IIRC, we use our own reference Resolver, which is a wrapper of the Using the previous example, the resolver will resolve WDYT @magicmatatjahu? Maybe there is a simpler approach but it scapes from my knowledge then. |
There should be a possibility to check the references (I mean the dereferenced messages) by the reference in JS memory, so comparison of two messages which are referenced from this same reference should be equal EDIT: if references won't work, there is still possibility to use the |
@wiegell would you like to work on the fix considering the suggested solutions @magicmatatjahu posted? We can bring you assistance if you need it. |
Thank you for the confidence, but i don't have the time atm. Also the messageId is not vital to my current project. Out of curiosity: does any of the code generators transpile the messageId into one of the destination languages? In go i only get the schema structs. |
I had the same issue when trying to generate code with the async-api generator. I used a file template: As a workaround I use "x-parser-message-name" on the messages since this is a fallback for the id field. |
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 ❤️ |
Describe the bug
One message cannot be reused in publish and subscribe in the same channel, if a messageId is defined on the message
To Reproduce
Steps to reproduce the behavior:
asyncapi generate models golang
error asyncapi2-message-messageId-uniqueness "messageId" must be unique across all the messages.
Expected behavior
This should be possible. My usecase is that i want the same service to publish and subscribe to the same eventstore channel, that is used to persist data
The text was updated successfully, but these errors were encountered: