Skip to content

Conversation

@yelizhenden-mdb
Copy link
Collaborator

@yelizhenden-mdb yelizhenden-mdb commented Mar 26, 2025

Proposed changes

Jira ticket: CLOUDP-304949
CLOUDP-304950
CLOUDP-304951
CLOUDP-304952
CLOUDP-304953

Implements xgen-IPA-110-collections-request-has-pageNum-query-param and xgen-IPA-110-collections-request-has-itemsPerPage-query-param rules

#### xgen-IPA-110-collections-request-has-itemsPerPage-query-param

The request should support an integer itemsPerPage query parameter allowing users to specify the maximum number of results to return per page.
itemsPerPage must not be required
itemsPerPage default value should be 100.

##### Implementation details
Rule checks for the following conditions:
  - Only applies to List methods (GET on resource collection paths)
  - Verifies the operation includes itemsPerPage query parameter
  - Verifies the itemsPerPage query parameter is not required
  - Verifies the itemsPerPage query parameter has a default value of 100

#### xgen-IPA-110-collections-request-has-pageNum-query-param

The request should support an integer pageNum query parameter allowing users to specify the maximum number of results to return per page.
pageNum must not be required
pageNum default value should be 1.

##### Implementation details
Rule checks for the following conditions:
  - Only applies to List methods (GET on resource collection paths)
  - Verifies the operation includes pageNum query parameter
  - Verifies the pageNum query parameter is not required
  - Verifies the pageNum query parameter has a default value of 1

Found 13 violations for both of them. The same ones violate the validations for the Paginated prefix and results array.

Checklist

  • I have signed the MongoDB CLA
  • I have added tests that prove my fix is effective or that my feature works

Changes to Spectral

  • I have read the README file for Spectral Updates

Further comments

@yelizhenden-mdb yelizhenden-mdb marked this pull request as ready for review March 26, 2025 13:13
@yelizhenden-mdb yelizhenden-mdb requested a review from a team as a code owner March 26, 2025 13:13
@yelizhenden-mdb yelizhenden-mdb merged commit c596360 into main Mar 26, 2025
8 checks passed
@yelizhenden-mdb yelizhenden-mdb deleted the CLOUDP-304949 branch March 26, 2025 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants