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(rulesets): add rule to check uniqueness operationId of AsyncAPI operations #2121

Merged

Conversation

magicmatatjahu
Copy link
Contributor

@magicmatatjahu magicmatatjahu commented Apr 11, 2022

Fixes #2102

Checklist

  • Tests added / updated
  • Docs added / updated

Does this PR introduce a breaking change?

  • Yes
  • No

Additional context

Part of #2100

Add rule to check uniqueness operationId of AsyncAPI operations.

Bad Example

channels:
  smartylighting.streetlights.1.0.action.{streetlightId}.turn.on:
    publish:
      operationId: turn
  smartylighting.streetlights.1.0.action.{streetlightId}.turn.off:
    publish:
      operationId: turn

Good Example

channels:
  smartylighting.streetlights.1.0.action.{streetlightId}.turn.on:
    publish:
      operationId: turnOn
  smartylighting.streetlights.1.0.action.{streetlightId}.turn.off:
    publish:
      operationId: turnOff

@magicmatatjahu magicmatatjahu added enhancement New feature or request AsyncAPI Issues related to the AsyncAPI ruleset labels Apr 11, 2022
Copy link
Collaborator

@jonaslagoni jonaslagoni left a comment

Choose a reason for hiding this comment

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

LGTM 👍 Think CI check is false positive for something else 🧐

@magicmatatjahu
Copy link
Contributor Author

That PR is "broken" because it doesn't handle operationId inside traits. I will fix it as soon as possible.

@daimenworrall-cinch
Copy link

Hello, are there any updates on this PR? We have also found this and need it to be fixed for our pipelines. Thanks :)

@P0lip P0lip merged commit 8b3cce4 into stoplightio:develop May 30, 2022
@magicmatatjahu magicmatatjahu deleted the asyncapi/operation-uniqueness branch May 30, 2022 12:18
stoplight-bot pushed a commit that referenced this pull request May 31, 2022
# [@stoplight/spectral-rulesets-v1.9.0](https://github.com/stoplightio/spectral/compare/@stoplight/spectral-rulesets-v1.8.0...@stoplight/spectral-rulesets-v1.9.0) (2022-05-31)

### Features

* **rulesets:** add rules for validation of server variables and channel parameters ([#2101](#2101)) ([9acc633](9acc633))
* **rulesets:** add rules for validation uniqueness of tag names ([#2104](#2104)) ([4447d81](4447d81))
* **rulesets:** check uniqueness of AsyncAPI operations ([#2121](#2121)) ([8b3cce4](8b3cce4))
@stoplight-bot
Copy link
Collaborator

🎉 This PR is included in version @stoplight/spectral-rulesets-v1.9.0 🎉

The release is available on npm package (@latest dist-tag)

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AsyncAPI Issues related to the AsyncAPI ruleset enhancement New feature or request released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add rule to check uniqueness of operationId
5 participants