Bug 32801: Prevent 500 on /checkouts

If checked_in flag is passed we return the "old checkouts". But if the
item has been deleted we explode with
  "message":"Expected integer - got null.","path":"\/0\/item_id"

The specs should reflect that an item can have been deleted.

Test plan:
Hit the endpoint and confirm the above.
Can be done easily using curl:
  curl -u koha:koha --request GET 'http://localhost:8081/api/v1/checkouts?patron_id=5&checked_in=1' --header "Content-Type: application/json" | jq

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Jonathan Druart 2023-07-05 12:26:09 +02:00 committed by Tomas Cohen Arazi
parent b157a2cd7f
commit c4cb183ae1
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F

View file

@ -8,7 +8,9 @@ properties:
type: integer
description: Internal patron identifier
item_id:
type: integer
type:
- integer
- "null"
description: internal identifier of checked out item
due_date:
type: string