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
messageTrait not applied when message not used in a channel #210
Comments
Welcome to AsyncAPI. Thanks a lot for reporting your first issue. Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue. |
@c-pius Hey, thanks for reporting. I will move this issue under parser-js repo as it is the responsibility of the parser to apply traits according to the spec and this component just uses the parser. Problem is here. We apply traits only to messages under operations as you wrote. Looking quickly into code looks like we just need to use It would be awesome if you could craft a PR for this |
Welcome to AsyncAPI. Thanks a lot for reporting your first issue. Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue. |
🎉 This issue has been resolved in version 1.3.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Description
We want to integrate the react component into our project for displaying specifications of messages to be implemented. Because the messages are not implemented but only specified by us, we define them only in the
components/messages
section and don't use thechannels
section (passing an empty object).However, if the message is not referenced from a channel, it doesn't apply the used
messageTraits
to the message.Expected result
Message traits should be applied to the message even if the message is not used in channel. All properties from the used trait should be shown as part of the message.
Actual result
Message trait is only applied if the message is used within a channel. In the case the message is used in a channel, you can see the properties from the trait in both the channel, and the message object.
Steps to reproduce
Find a minimal example here. The "light measured" message is used in a channel and the "commonHeaders" trait is applied correctly ("my-app-header" property shown in the channel and the message).
The "turn off" message is not used in a channel. The "commonHeaders" trait is NOT applied and you won't find the headers section with the "my-app-header" property.
message-channel-trait-example.txt
Troubleshooting
The text was updated successfully, but these errors were encountered: