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): check uniqueness of AsyncAPI messages #2224

Merged
merged 4 commits into from Aug 24, 2022

Conversation

magicmatatjahu
Copy link
Contributor

@magicmatatjahu magicmatatjahu commented Jul 28, 2022

Fixes #2223

Checklist

  • Tests added / updated
  • Docs added / updated

Does this PR introduce a breaking change?

  • Yes
  • No

If indicated yes above, please describe the breaking change(s).

Remove this quote before creating the PR.

Part of #2100

Add rule to check uniqueness messageId of AsyncAPI messages.

Bad Example

channels:
  smartylighting.streetlights.1.0.action.{streetlightId}.turn.on:
    publish:
      message:
        messageId: turnMessage
  smartylighting.streetlights.1.0.action.{streetlightId}.turn.off:
    publish:
      message:
        messageId: turnMessage

Good Example

channels:
  smartylighting.streetlights.1.0.action.{streetlightId}.turn.on:
    publish:
      message:
        messageId: turnOnMessage
  smartylighting.streetlights.1.0.action.{streetlightId}.turn.off:
    publish:
      message:
        messageId: turnOffMessage

Also fix rule for operationId uniqueness - check operationId in operation's traits.

cc @smoya @jonaslagoni

@magicmatatjahu magicmatatjahu added enhancement New feature or request AsyncAPI Issues related to the AsyncAPI ruleset labels Jul 28, 2022
jonaslagoni
jonaslagoni previously approved these changes Jul 28, 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 👍

smoya
smoya previously approved these changes Jul 29, 2022
Copy link
Collaborator

@smoya smoya left a comment

Choose a reason for hiding this comment

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

LGTM!

@P0lip P0lip requested a review from a team as a code owner August 23, 2022 12:35
@P0lip P0lip requested a review from pamgoodrich August 23, 2022 12:35
pamgoodrich
pamgoodrich previously approved these changes Aug 23, 2022
Copy link
Contributor

@pamgoodrich pamgoodrich left a comment

Choose a reason for hiding this comment

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

Approve the doc file with one small change.

docs/reference/asyncapi-rules.md Outdated Show resolved Hide resolved
@P0lip P0lip dismissed stale reviews from pamgoodrich, smoya, and jonaslagoni via 1c15a52 August 24, 2022 08:25
Copy link
Contributor

@P0lip P0lip left a comment

Choose a reason for hiding this comment

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

Nice work

@P0lip P0lip enabled auto-merge (squash) August 24, 2022 08:26
@P0lip
Copy link
Contributor

P0lip commented Aug 24, 2022

Apologies for a delay - was taking time off, and this one felt through my cracks.
Do feel free to merge next time :)

@P0lip P0lip disabled auto-merge August 24, 2022 08:30
@P0lip P0lip merged commit 297531b into stoplightio:develop Aug 24, 2022
stoplight-bot pushed a commit that referenced this pull request Aug 24, 2022
# [@stoplight/spectral-rulesets-v1.12.0](https://github.com/stoplightio/spectral/compare/@stoplight/spectral-rulesets-v1.11.3...@stoplight/spectral-rulesets-v1.12.0) (2022-08-24)

### Features

* **rulesets:** check uniqueness of AsyncAPI messages ([#2224](#2224)) ([297531b](297531b))
@stoplight-bot
Copy link
Collaborator

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

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

Your semantic-release bot 📦🚀

@magicmatatjahu
Copy link
Contributor Author

@P0lip @pamgoodrich Thanks for review and suggestion! Just today I saw this review but I also saw that it is merged 😄 Nothing is wrong, we help in this project so we can wait :)

@magicmatatjahu magicmatatjahu deleted the asyncapi/message-uniqueness branch August 24, 2022 09:45
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 messageId
6 participants