-
-
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 Spectral rule to validate operation messages #911
feat: add Spectral rule to validate operation messages #911
Conversation
const channelPointer = targetVal.channel?.$ref as string; // required | ||
|
||
targetVal.messages?.forEach((message, index) => { | ||
if (!message.$ref.startsWith(`${channelPointer}/messages`)) { |
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.
Is it that simple, or am I'm missing any edge case here? 🤔
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.
I think that's right yeah 👍
Kudos, SonarCloud Quality Gate passed! |
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 👍
const channelPointer = targetVal.channel?.$ref as string; // required | ||
|
||
targetVal.messages?.forEach((message, index) => { | ||
if (!message.$ref.startsWith(`${channelPointer}/messages`)) { |
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.
I think that's right yeah 👍
🎉 This PR is included in version 3.0.0-next-major-spec.13 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Description
Part of asyncapi/spec#991
This PR adds all the scaffolding for adding Spectral rules to v3 plus the first of three new rules related with asyncapi/spec#991.
This rule, in particular, checks that operation messages, no matter where they are located, need to point to messages from the channel specified in its channel field.
Related issue(s)
asyncapi/spec#991