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 rules for validation of server variables and channel parameters #2101

Merged

Conversation

magicmatatjahu
Copy link
Contributor

@magicmatatjahu magicmatatjahu commented Mar 22, 2022

Fixes #1102

Checklist

  • Tests added / updated
  • Docs added / updated

Does this PR introduce a breaking change?

  • Yes
  • No

Context

Two new rules add the ability to validate variables in server address and parameters in channel address. All variables/parameters must be defined and there can be no redundant variables/parameters.

NOTE: workflows responsible for linting code and markdowns show errors, but in files which I have not changed at all... 🤷🏼

@magicmatatjahu magicmatatjahu added enhancement New feature or request AsyncAPI Issues related to the AsyncAPI ruleset labels Mar 22, 2022
@magicmatatjahu magicmatatjahu changed the title feat: add rules for validation of server variables and channel parameters feat(rulesets): add rules for validation of server variables and channel parameters Mar 22, 2022
@magicmatatjahu magicmatatjahu force-pushed the validate-server-channel-variables branch from e8f96e4 to be69a69 Compare March 22, 2022 09:50
packages/rulesets/src/asyncapi/index.ts Outdated Show resolved Hide resolved
packages/rulesets/src/asyncapi/index.ts Outdated Show resolved Hide resolved
@magicmatatjahu magicmatatjahu marked this pull request as ready for review March 22, 2022 09:56
Copy link
Contributor

@marbemac marbemac left a comment

Choose a reason for hiding this comment

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

One small thought re code org, otherwise the implementation looks pretty good! @P0lip, any other thoughts?

Also @P0lip do you know what's up with the lint check?

packages/rulesets/src/asyncapi/functions/utils.ts Outdated Show resolved Hide resolved
@magicmatatjahu
Copy link
Contributor Author

@marbemac @P0lip Hi! Sorry for such delay but I had a lot of other things to do in our organization. I will try to deliver most of the rules that are missing by the end of next week. I propagated review suggestions. Thanks again for the review!

Copy link
Member

@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.

Left 2 comments. Nice work!

@magicmatatjahu magicmatatjahu force-pushed the validate-server-channel-variables branch from 76df19a to d2607e1 Compare May 19, 2022 10:39
@magicmatatjahu magicmatatjahu force-pushed the validate-server-channel-variables branch from eb2949e to efd4116 Compare May 19, 2022 10:49
@magicmatatjahu
Copy link
Contributor Author

@P0lip Sorry for such a delay! All suggestions have been applied. Let me know if everything is ok and if it is ok, you can merge when you want :) Unfortunately I had to do a mixed reset + force push (it was the easiest way for me) because the commit linting was showing me errors when I merged from the Github UI develop branch to my PR.

Copy link
Member

@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.

Thanks for addressing the comments!

@P0lip P0lip enabled auto-merge (squash) May 30, 2022 11:35
@P0lip P0lip disabled auto-merge May 30, 2022 11:59
@P0lip P0lip merged commit 9acc633 into stoplightio:develop May 30, 2022
@magicmatatjahu magicmatatjahu deleted the validate-server-channel-variables branch May 30, 2022 12:10
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.

[AsyncAPI] Enhance parameters and variables linting
4 participants