- request:
- `per_page` for the number of items per page (there should be a max: 500 and a default: 10)
- `page` : show the nth page of search results (based on the amount per page set above)
- response:
- needs to contain the amount of results requested (at most)
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 notes:**
- use `limit` instead of `per_page`
- no indication of the next page
- `page` is not required, therefore defaults to 1
subtasks:
- Adjust the OpenAPI document
- happy path for InLabelSearchEngine
- happy path for SqlTermStoreSearchEngine
- validation: per page needs to be a number between 1 and 500; page needs to be a number >=1
- rely on the REST framework's [[ https://gerrit.wikimedia.org/g/mediawiki/core/+/e0f5bccecf17558c5e336eccb25cc2e5319a51a8/includes/Rest/Handler/SearchHandler.php#414 | request parameter validation ]] for type check
- do validation of the paramter's range inside the use case, using the validator
- 400 error response, to be confirmed by @Ifrahkhanyaree_WMDE
```
{
"code": "query-parameter-out-of-range",
"message": "Query parameter out of range: 'limit'",
"context": {
"parameter": "limit"
"limit": "500"
}
}
```