From f23ca87c3df7a3a34f2a5a504514a840ba1e12b5 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 5 Jul 2023 12:26:09 +0200 Subject: [PATCH] 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 Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi (cherry picked from commit c4cb183ae1f7225c86a38178176c966ad9cebeda) Signed-off-by: Martin Renvoize (cherry picked from commit ac1febd685936a168f853741be45fd58a445c1c3) Signed-off-by: Matt Blenkinsop --- api/v1/swagger/definitions/checkout.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/api/v1/swagger/definitions/checkout.yaml b/api/v1/swagger/definitions/checkout.yaml index e2a4d733ca..4a9847623c 100644 --- a/api/v1/swagger/definitions/checkout.yaml +++ b/api/v1/swagger/definitions/checkout.yaml @@ -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 -- 2.20.1