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

Add a rule to validate message's examples #2125

Closed
magicmatatjahu opened this issue Apr 12, 2022 · 1 comment · Fixed by #2126
Closed

Add a rule to validate message's examples #2125

magicmatatjahu opened this issue Apr 12, 2022 · 1 comment · Fixed by #2126
Labels
AsyncAPI Issues related to the AsyncAPI ruleset enhancement New feature or request released

Comments

@magicmatatjahu
Copy link
Contributor

User story.
As a user I want to know if the examples defined in the message object are valid.

Is your feature request related to a problem?
The following AsyncAPI document is invalid and Spectral should throw errors:

asyncapi: "2.0.0"
info:
  title: Bad API
  version: "1.0.0"
components:
  messages:
    someMessage:
      payload:
        type: string
      headers:
        type: object
      examples:
        - payload: 2137 # should be string
          headers: someHeader # should have object shape

Additional context
Part of #2100

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

🎉 This issue has been resolved in version @stoplight/spectral-rulesets-v1.10.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 a pull request may close this issue.

2 participants