Boolean fields accept numbers

Description

When I was testing OLMIS-6347, I noticed that boolean fields accept numbers. It's a general issue, occurring not only in the systemNotifications endpoint.

Reproduction steps:

  1. Log into the application as administrator and obtain the user's access token.

  2. With the use of the POST systemNotifications endpoint, try to create a notification with 0 as the value of the "active" field.

  3. The notification is created and the field gets set to false.

  4. With the use of the POST systemNotifications endpoint, try to create a notification with e.g. 1 as the value of the "active" field.

  5. The notification is created, and the field gets set to true.

All of the above is valid also in notification edition.

Expected results:

  • Boolean fields in all endpoints should only accept the following values: true and false.

Activity

Show:
Joanna Bebak
July 2, 2019, 12:29 PM

I was able to reproduce the issue.

Assignee

Unassigned

Reporter

Joanna Bebak

Labels