-
Notifications
You must be signed in to change notification settings - Fork 158
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: create new rule to enforce array parameters format #1338
Conversation
🦋 Changeset detectedLatest commit: 2a4a1a8 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Coverage report
Show new covered files 🐣
Test suite run success652 tests passing in 94 suites. Report generated by 🧪jest coverage report action from 2a4a1a8 |
Could we get a changeset please? The rule name doesn't need |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor changelog suggestion, I haven't tried the feature itself yet
|
||
## Related rules | ||
|
||
- [configurable rules](./configurable-rules.md) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it related? In what way?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think so, we created this rule from similar configurable rules.
I think I broke something! The following snippet does return as valid, which is correct:
However if the |
Thanks @lornajane I updated the code and added it to test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we add a test where explode is defined, but false? When I do this on my local version, the rule fails.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Working as expected now (that failing link check is because we can't publish docs at the moment, so feel free to merge regardless)
e06e57a
to
2a4a1a8
Compare
What/Why/How?
Create new rule
array-parameter-serialization
rule to enforce array parameters format.This Rule enforces to define fields
explode
andstyle
for parameter if param's schema type isarray
or hasitems
orpreffixItems
Reference
Testing
#1317
Screenshots (optional)
Check yourself
Security