From 5e503a77c9f11fb431ef17a42cce4a905ae6472a Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Tue, 6 Jan 2026 10:43:44 +0000 Subject: [PATCH] Bug 41530: Rename item_type => item_type_id in suggestions API spec Following the API consistency work in bug 41456, this patch renames the item_type field to item_type_id in the suggestions API definition. The field should only be named item_type when it contains an embedded object (type: object/null). When it contains a foreign key ID (type: string/null), it should be named item_type_id for consistency. Changes: - Updated api/v1/swagger/definitions/suggestion.yaml - Updated Koha::Suggestion->to_api_mapping Test plan: 1. Run API tests: prove t/db_dependent/api/v1/suggestions.t 2. Verify suggestions API continues to work correctly 3. Check that item_type_id field is properly mapped in API responses --- Koha/Suggestion.pm | 2 +- api/v1/swagger/definitions/suggestion.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Koha/Suggestion.pm b/Koha/Suggestion.pm index 8c1481c57ac..2d0d369194e 100644 --- a/Koha/Suggestion.pm +++ b/Koha/Suggestion.pm @@ -285,7 +285,7 @@ sub to_api_mapping { budgetid => 'budget_id', branchcode => 'library_id', collectiontitle => 'collection_title', - itemtype => 'item_type', + itemtype => 'item_type_id', quantity => 'quantity', currency => 'currency', price => 'item_price', diff --git a/api/v1/swagger/definitions/suggestion.yaml b/api/v1/swagger/definitions/suggestion.yaml index 4567c5c3422..f1ca1267f73 100644 --- a/api/v1/swagger/definitions/suggestion.yaml +++ b/api/v1/swagger/definitions/suggestion.yaml @@ -161,7 +161,7 @@ properties: - string - "null" description: collection name for the suggested item - item_type: + item_type_id: type: - string - "null" -- 2.52.0