- r**Request:**:
- `per_page` for the number of items per page (there should be a max: 500 and a default: 10)Two query parameters:
- `page` : show the nth page of search results (based on the amount per page set above- `limit` - the number of items to show in the results (max: 500, default: 10)
- `offset` - the index to start showing results from (default: 0)
- r**Response:**:
- needs to contain the amount of results requested (at most)- 200:
- an array of 0 - `limit` search results
- 400:
- the usual `invalid-query-parameter` if either query parameter is out of range
Notes:
- If a user requests a page greater than the total amount of search result pages, we will return an empty list
- We will not indicate the total number of search results or the total number of pages of search results (`[]`)
**Task Breakdown- At this stage we will notes:** indicate:
- use `limit` instead - the total number of search results or the total number of pages of `per_page`search results
- no indication of the next - the next and/or previous pagee of results
- `page` is not required, therefore defaults to 1
**Task Breakdown notes:**
subtasks:
- Adjust the OpenAPI document
- happy path for InLabelSearchEngine
- happy path for SqlTermStoreSearchEngine
- validation: per page`limit` needs to be a number between 1 and 500; page`offset` needs to be a number >=1=0
- rely on the REST framework's [[ https://gerrit.wikimedia.org/g/mediawiki/core/+/e0f5bccecf17558c5e336eccb25cc2e5319a51a8/includes/Rest/Handler/SearchHandler.php#4141 | request parameter validation ]] for type check
- do validation of the paramter's range inside the use case, using the validator
- 400 error response:
```
{
"code": "invalid-query-parameter",
"message": "Invalid query parameter: 'limit'",
"context": {
"parameter": "limit"
}
}
```