Internal Server Error is returned after entering an even page number without providing the size parameter

Description

I noticed an issue when I was testing but I know that it occurs for all endpoints. When I tried to fetch the a given page of system notifications, I noticed that after entering an even number in the page parameter (e.g. 2, 4, 6, 10, 20), the Internal Server Error is returned, as on the screenshot.

Reproduction steps:

  1. Create several system notifications as the administrator.

  2. Obtain the user's access token.

  3. Try to fetch the second page of notifications with the use of the GET systemNotifications endpoint.

  4. The error from the screenshot occurs, and the notifications are not returned.

Expected result:

  • Some general solution should be implemented for all endpoints;

  • The endpoint should return bad request error with an error message that the size parameter wasn't provided.

    • the size parameter has to be greater than zero

  • the solution should be applied to all services

  • document solution on docs.openlmis.org

 

Environment

None

Status

Assignee

Aleksandra Sołtys

Reporter

Joanna Bebak

Labels

None

Story Points

3

Time tracking

32h

Sprint

None

Fix versions

Priority

Major