-
Notifications
You must be signed in to change notification settings - Fork 14
CLOUDP-271998: IPA-110: Pagination (Validate Paginated prefix and results array field) #601
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
… provide pagination (Part 1)
tools/spectral/ipa/__tests__/IPA110CollectionsUsePaginatedSchema.test.js
Outdated
Show resolved
Hide resolved
tools/spectral/ipa/__tests__/IPA110CollectionsUsePaginatedSchema.test.js
Outdated
Show resolved
Hide resolved
tools/spectral/ipa/__tests__/IPA110CollectionsUsePaginatedSchema.test.js
Outdated
Show resolved
Hide resolved
tools/spectral/ipa/rulesets/functions/IPA110CollectionsUsePaginatedSchema.js
Outdated
Show resolved
Hide resolved
|
|
That information should be present in the openapi already. Using name as assumption might lead to false negatives. |
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.
Suggesting to use reliance on the base class or check for format of the fields instead of the name.
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.
Disscussed offline. Yeliz to make changes based on new IPA proposed rule.
Unblocking
Proposed changes
Jira ticket: CLOUDP-271998 and CLOUDP-304955
This PR validates
Paginated" prefix. (Related guideline amendment PR: https://github.com/10gen/ipa/pull/64)Clarification: The associated guideline the
xgen-IPA-110-collections-response-define-results-arrayrule validating isThe response for collections must define an array of results containing the paginated resourceThis guideline is shared with
xgen-IPA-105-list-method-response-is-get-method-responserule. The rule is already checking if the results array containing the paginated resource when the results array exists. Different than that,xgen-IPA-110-collections-response-define-results-arrayrule only checks if the List method response have a schema with results (array) fields.Follow-up
linksfield followingApiListViewimplementation will be validated in scope of another guidelineThe response for collections should define an array of links field, providing the user with links to the next and previous pagestotalCountfield is not required as it is mentioned in theThe response for collections may provide an integer totalCount field, providing the user with the total number of resources available in the backing collection. This total may be an estimate but the API should explicitly document thatChecklist
Changes to Spectral
Further comments