Endpoint pagination inconsistency with non-positive pageSize values
0 reputation · 26 Apr 2023, 19:49 UTC
Since Portainer 2.12, the /api/endpoints endpoint supports pagination via the page and pageSize query parameters. While positive integers correctly limit the result set, the API's behavior when encountering non-positive integers remains undefined.
When an automation script passes a pageSize of zero or a negative value, the API does not return a 400 Bad Request error. Instead, the response either returns an empty array or the entire dataset depending on the internal logic. This lack of predictability creates risks for scripts that dynamically calculate bounds for large environments.
- Does the API return an empty set or the full endpoint list when pageSize is set to zero?
- Is there a functional difference in the response between a zero and a negative pageSize value?