-
-
Notifications
You must be signed in to change notification settings - Fork 106
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
No functions to access message and operation traits #226
Comments
This was exactly my question after reading the context section. What is the use case here really? |
@derberg You wouldn't IMO, however as stated you have no way to access those traits (without accessing the underlying json schema) if you for example parse an AsyncAPI document with the option |
oh, you found the use case, if we allow |
This issue has been automatically marked as stale because it has not had recent activity 😴 |
@derberg @jonaslagoni We have option to access to traits by |
This issue has been automatically marked as stale because it has not had recent activity 😴 |
This issue has been automatically marked as stale because it has not had recent activity 😴 |
@magicmatatjahu if someone wants to access traits with |
@KhudaDad414 Exactly, won't be, but will be the native |
🎉 This issue has been resolved in version 1.9.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Reason/Context
Even though we provide access to message and operation traits if listed in the components sections, there exist no functions on the operation and message objects themselves to access traits if you use the parser with the option
applyTraits = false
.Description
I would expect functions such as the following to be available:
Message trait:
asyncapi.channel('mychannel').publish().message().traits();
Operation trait:
asyncapi.channel('mychannel').publish().traits();
It is possible to access the traits using the following
Message trait:
asyncapi.channel('mychannel').publish().message()._json.traits
Operation trait:
asyncapi.channel('mychannel').publish()._json.traits
Up for discussion:
If the traits are already applied, would you really want access to the original traits 🤔 ?
The text was updated successfully, but these errors were encountered: