Skip to content
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 required operation channel field #5

Closed

Conversation

smoya
Copy link
Owner

@smoya smoya commented Nov 27, 2023

Description

Part of asyncapi/spec#991

This PR adds the second of two new rules related with asyncapi/spec#991.
This rule, in particular, checks that the channel field of a required operation (under root) points to a required (under root) channel and not to an optional (under components) channel, no matter if from the same document or from an external.

Important

This PR is pointing to smoya/feat/v3OperationMessagesRule because is it there where all the scaffolding for supporting Spectral rules in v3 is located. Once asyncapi#911 is merged, I will close this PR and open a new one on the asyncapi repo.

Related issue(s)
asyncapi/spec#991

@@ -24,5 +25,18 @@ export const v3CoreRuleset = {
function: operationMessagesUnambiguity,
},
},
'asyncapi3-required-operation-channel-unambiguity': {
description: 'Required operation (under root channels) "channel" must reference to a required channel (under root channels).',

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
description: 'Required operation (under root channels) "channel" must reference to a required channel (under root channels).',
description: 'Operation channel's must reference to a required channel (under root channels).',

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Co-authored-by: Fran Méndez <fmvilas@gmail.com>
@smoya
Copy link
Owner Author

smoya commented Nov 28, 2023

Closing in favor of asyncapi#913

@smoya smoya closed this Nov 28, 2023
@smoya smoya deleted the feat/v3RequiredOperationChannelRule branch November 28, 2023 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants