-
Notifications
You must be signed in to change notification settings - Fork 14
CLOUDP-305862 - Add missing rule Technical Specifications #546
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
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
98edacd
fix: IPA-104 descriptions
wtrocki d4d6746
fix: IPA-105
wtrocki e07cd89
IPA-106
wtrocki 6dadb69
IPA-108
wtrocki 6749e24
IPA-108
wtrocki 970cf2a
IPA-123
wtrocki e4f3814
IPA-113
wtrocki c75b8e7
IPA-109
wtrocki ef64229
fix: minor clarification for 113
wtrocki 834a776
fix: lint and regenerate docs
wtrocki 9db89a3
fix: IPA-108
wtrocki 668bdca
Lovisa comments
wtrocki 96fc6ae
fix: format
wtrocki 138f98f
Update tools/spectral/ipa/rulesets/IPA-108.yaml
wtrocki 3e25871
fix: regenerate documentation
wtrocki File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,31 +3,61 @@ | |
|
|
||
| rules: | ||
| xgen-IPA-108-delete-response-should-be-empty: | ||
| description: Delete method response should not have schema reference to object. | ||
| description: | | ||
| Delete method response should not have schema reference to object. | ||
|
|
||
| ##### Implementation details | ||
| Rule checks for the following conditions: | ||
| - Applies to 204 responses in DELETE methods | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. After CLOUDP-306347, we can also add There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. SGTM |
||
| - Verifies that the response does not contain a schema property | ||
| - Fails if any content type in the response has a defined schema as reference | ||
| message: '{{error}} https://mdb.link/mongodb-atlas-openapi-validation#xgen-IPA-108-delete-response-should-be-empty' | ||
| severity: warn | ||
| given: $.paths[*].delete.responses[204] | ||
| then: | ||
| function: IPA108DeleteMethodResponseShouldNotHaveSchema | ||
|
|
||
| xgen-IPA-108-delete-method-return-204-response: | ||
| description: DELETE method must return 204 No Content. | ||
| description: | | ||
| DELETE method must return 204 No Content. | ||
|
|
||
| ##### Implementation details | ||
| Rule checks for the following conditions: | ||
| - Applies to all DELETE methods | ||
| - Verifies the 204 No Content response code is present | ||
| - Fails if the method lacks a 204 No Content response or defines a different 2xx status code | ||
| - Ensures no other 2xx response codes are defined | ||
| - Fails if the 204 status code is missing or if other 2xx responses exist | ||
| message: '{{error}} https://mdb.link/mongodb-atlas-openapi-validation#xgen-IPA-108-delete-method-return-204-response' | ||
| severity: warn | ||
| given: $.paths[*].delete | ||
| then: | ||
| function: IPA108DeleteMethod204Response | ||
|
|
||
| xgen-IPA-108-delete-include-404-response: | ||
| description: DELETE method must include 404 response and return it when resource not found. | ||
| description: | | ||
| DELETE method must include 404 response and return it when resource not found. | ||
|
|
||
| ##### Implementation details | ||
| Rule checks for the following conditions: | ||
| - Applies to all DELETE methods | ||
| - Verifies that the method includes a 404 response code | ||
| - Fails if the 404 status code is missing from the responses | ||
| message: '{{error}} https://mdb.link/mongodb-atlas-openapi-validation#xgen-IPA-108-delete-include-404-response' | ||
| severity: warn | ||
| given: $.paths[*].delete | ||
| then: | ||
| function: IPA108DeleteMethod404Response | ||
|
|
||
| xgen-IPA-108-delete-request-no-body: | ||
| description: DELETE method must not have request body. | ||
| description: | | ||
| DELETE method must not have request body. | ||
|
|
||
| ##### Implementation details | ||
| Rule checks for the following conditions: | ||
| - Applies to all DELETE methods | ||
| - Verifies that the operation object does not contain a requestBody property | ||
| - Fails if any requestBody is defined for the DELETE method | ||
| message: '{{error}} https://mdb.link/mongodb-atlas-openapi-validation#xgen-IPA-108-delete-request-no-body' | ||
| severity: warn | ||
| given: $.paths[*].delete | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.