-
Notifications
You must be signed in to change notification settings - Fork 14
CLOUDP-271991: IPA-104: Validate for Get methods the response is 200 #462
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
Conversation
| return; | ||
| } | ||
|
|
||
| if (input['responses']) { |
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.
Something to consider here is that this test will cover IPA 105 List as well, since it's also a HTTP GET method, which may skew the metrics, and will cause duplicate validation if we are planning to implement the same check for IPA 105.
Also, this covers custom methods too, though IIRC we don't define that custom method GET should return 200. Maybe we should introduce a guideline for this on custom methods, or not do the validation if we think there is a reason for custom gets to return a 202 for example (though IMO it should be a custom post in that case)
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 modified the code as "If it is a custom method or collection resource (not a child with current glossary), the rule will be bypassed". Let me know what you think
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.
Thanks!
| return; | ||
| } | ||
|
|
||
| if (input['responses']) { |
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.
Thanks!
Proposed changes
Jira ticket: CLOUDP-271991
Implements a Spectral rule to validate if Get method (single resource) has 200 OK status code and no other 2xx responses
If it is a custom method or collection resource, the rule will be bypassed.
Checklist
Changes to Spectral