Can't determine when page limit is for search request based on error message
The Search API is limited to only returning a maximum number of matching results for a query (default is 10,000 results total). When this limit is reached a 400 error is returned however no details are provided about what parameters are invalid.
Below is an example search request that retrieves records beyond the max allowed limit:
curl --location --request POST 'https://r3m11.preshiptesting.osdu.aws/api/search/v2/query' \
--header 'data-partition-id: osdu' \
--header 'Authorization: Bearer ...' \
--header 'Content-Type: application/json' \
--data-raw '{
"kind": "osdu:wks:work-product-component--WellboreTrajectory:*",
"limit": 1000,
"offset": 10000
}'
Response:
{
"code": 400,
"reason": "Bad Request",
"message": "Invalid parameters were given on search request"
}
The generic 400 error message "Invalid parameters were given on search request" makes it difficult for the user to determine what parameters were specified incorrectly in the request.
Ideally, the message should be more specific about what parameters are invalid and why.