From 6c2ed45780379a5552d424bbaa22ef3d29c639f1 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Tue, 22 Jun 2021 08:52:56 -0300 Subject: [PATCH] Bug 28613: Add missing parameters to objects.search-based routes The objects.search helper provides convenient ways to paginate and a 'q' filter parameter to build complex queries on this Koha::Objects-based routes. Some routes were created prior to this feature getting introduced. We need to adjust the parameters for all existing objects.search-based routes. This patch adds that. The only GET (as in list) routes that would still be missing the parameters are those about ILL, that are not objects.search based, and probably need to be rewritten. Signed-off-by: Martin Renvoize Signed-off-by: Jonathan Druart Signed-off-by: Kyle M Hall --- api/v1/swagger/paths/acquisitions_funds.json | 12 +++++++++-- .../swagger/paths/acquisitions_vendors.json | 6 ++++++ .../swagger/paths/advancededitormacros.json | 21 +++++++++++++++++++ api/v1/swagger/paths/checkouts.json | 6 ++++++ .../swagger/paths/import_batch_profiles.json | 9 ++++++++ api/v1/swagger/paths/items.json | 9 ++++++++ 6 files changed, 61 insertions(+), 2 deletions(-) diff --git a/api/v1/swagger/paths/acquisitions_funds.json b/api/v1/swagger/paths/acquisitions_funds.json index 299a8776db..22e01660a7 100644 --- a/api/v1/swagger/paths/acquisitions_funds.json +++ b/api/v1/swagger/paths/acquisitions_funds.json @@ -33,8 +33,16 @@ }, { "$ref": "../parameters.json#/per_page" - } - ], + }, + { + "$ref": "../parameters.json#/q_param" + }, + { + "$ref": "../parameters.json#/q_body" + }, + { + "$ref": "../parameters.json#/q_header" + }], "responses": { "200": { "description": "A list of funds", diff --git a/api/v1/swagger/paths/acquisitions_vendors.json b/api/v1/swagger/paths/acquisitions_vendors.json index 32f67097bb..995e787957 100644 --- a/api/v1/swagger/paths/acquisitions_vendors.json +++ b/api/v1/swagger/paths/acquisitions_vendors.json @@ -28,6 +28,12 @@ "$ref": "../parameters.json#/page" }, { "$ref": "../parameters.json#/per_page" + }, { + "$ref": "../parameters.json#/q_param" + }, { + "$ref": "../parameters.json#/q_body" + }, { + "$ref": "../parameters.json#/q_header" }], "responses": { "200": { diff --git a/api/v1/swagger/paths/advancededitormacros.json b/api/v1/swagger/paths/advancededitormacros.json index fbc589988a..d28e1c9cc9 100644 --- a/api/v1/swagger/paths/advancededitormacros.json +++ b/api/v1/swagger/paths/advancededitormacros.json @@ -36,6 +36,27 @@ "description": "Search on shared macros", "required": false, "type": "string" + }, + { + "$ref": "../parameters.json#/match" + }, + { + "$ref": "../parameters.json#/order_by" + }, + { + "$ref": "../parameters.json#/page" + }, + { + "$ref": "../parameters.json#/per_page" + }, + { + "$ref": "../parameters.json#/q_param" + }, + { + "$ref": "../parameters.json#/q_body" + }, + { + "$ref": "../parameters.json#/q_header" } ], "responses": { diff --git a/api/v1/swagger/paths/checkouts.json b/api/v1/swagger/paths/checkouts.json index e79a5db01d..f3f36e53c3 100644 --- a/api/v1/swagger/paths/checkouts.json +++ b/api/v1/swagger/paths/checkouts.json @@ -15,6 +15,12 @@ "$ref": "../parameters.json#/match" }, { "$ref": "../parameters.json#/order_by" + }, { + "$ref": "../parameters.json#/q_param" + }, { + "$ref": "../parameters.json#/q_body" + }, { + "$ref": "../parameters.json#/q_header" },{ "name": "checked_in", "in": "query", diff --git a/api/v1/swagger/paths/import_batch_profiles.json b/api/v1/swagger/paths/import_batch_profiles.json index 9c6e1c5ba9..6363e9adbe 100644 --- a/api/v1/swagger/paths/import_batch_profiles.json +++ b/api/v1/swagger/paths/import_batch_profiles.json @@ -26,6 +26,15 @@ }, { "$ref": "../parameters.json#/per_page" + }, + { + "$ref": "../parameters.json#/q_param" + }, + { + "$ref": "../parameters.json#/q_body" + }, + { + "$ref": "../parameters.json#/q_header" } ], "consumes": [ diff --git a/api/v1/swagger/paths/items.json b/api/v1/swagger/paths/items.json index 0c9c7fbdef..eea5348909 100644 --- a/api/v1/swagger/paths/items.json +++ b/api/v1/swagger/paths/items.json @@ -26,6 +26,15 @@ }, { "$ref": "../parameters.json#/per_page" + }, + { + "$ref": "../parameters.json#/q_param" + }, + { + "$ref": "../parameters.json#/q_body" + }, + { + "$ref": "../parameters.json#/q_header" } ], "consumes": [ -- 2.39.5