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 oas3_1-servers-in-webhook and oas3_1-callbacks-in… #2581
Conversation
packages/rulesets/src/oas/index.ts
Outdated
message: 'Servers should not be defined in a webhook.', | ||
formats: [oas3_1], | ||
recommended: true, | ||
given: ['$.webhooks.servers'], |
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 we want this inside of the webhook operation, not at the webhooks object
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.
Ohhh okay servers can be defined on both. Should the warning only be at the webhook operation level?
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'm reading through the oas docs and it seems like we should be showing a warning at both levels (the servers array at the path item object level would apply to all operations and servers at the operation level is for that operation only)
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.
Ok added that here fb14f54
recommended: true, | ||
given: ['$.webhooks[*][*].callbacks'], | ||
then: { | ||
function: undefined, |
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.
are these required?
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.
Are you referring to the function: undefined
part? That function is checking if callbacks is undefined and if it's not then it'll show the warning.
cea7030
to
0f2b9a4
Compare
dc90b7a
to
c22f408
Compare
…-webhook rules
Fixes #[ISSUE_NUMBER].
Checklist
Does this PR introduce a breaking change?
Screenshots
If applicable, add screenshots or gifs to help demonstrate the changes. If not applicable, remove this screenshots section before creating the PR.
Additional context
Added two new spectral rules: