From 8bc0c2fd334aec40b6c9f2f8750cf36dd696592a Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Fri, 8 Jan 2021 13:15:58 -0300 Subject: [PATCH] Bug 27366: Spec changes Content-Type: text/plain; charset=utf-8 Signed-off-by: Lucas Gass Signed-off-by: Marcel de Rooy --- api/v1/swagger/paths.json | 3 ++ api/v1/swagger/paths/patrons_holds.json | 87 +++++++++++++++++++++++++++++++++ 2 files changed, 90 insertions(+) create mode 100644 api/v1/swagger/paths/patrons_holds.json diff --git a/api/v1/swagger/paths.json b/api/v1/swagger/paths.json index df30f36459..ebec766421 100644 --- a/api/v1/swagger/paths.json +++ b/api/v1/swagger/paths.json @@ -104,6 +104,9 @@ "/patrons/{patron_id}/account/credits": { "$ref": "paths/patrons_account.json#/~1patrons~1{patron_id}~1account~1credits" }, + "/patrons/{patron_id}/holds": { + "$ref": "paths/patrons_holds.json#/~1patrons~1{patron_id}~1holds" + }, "/patrons/{patron_id}/password": { "$ref": "paths/patrons_password.json#/~1patrons~1{patron_id}~1password" }, diff --git a/api/v1/swagger/paths/patrons_holds.json b/api/v1/swagger/paths/patrons_holds.json new file mode 100644 index 0000000000..ce2fcfa209 --- /dev/null +++ b/api/v1/swagger/paths/patrons_holds.json @@ -0,0 +1,87 @@ +{ + "/patrons/{patron_id}/holds": { + "get": { + "x-mojo-to": "Patrons::Holds#list", + "operationId": "getPatronHolds", + "tags": [ + "patrons", + "holds" + ], + "parameters": [ + { + "$ref": "../parameters.json#/patron_id_pp" + }, + { + "$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" + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "The patron holds", + "schema": { + "type": "array", + "items": { + "$ref": "../definitions.json#/hold" + } + } + }, + "401": { + "description": "Authentication required", + "schema": { + "$ref": "../definitions.json#/error" + } + }, + "403": { + "description": "Access forbidden", + "schema": { + "$ref": "../definitions.json#/error" + } + }, + "404": { + "description": "Patron not found", + "schema": { + "$ref": "../definitions.json#/error" + } + }, + "500": { + "description": "Internal server error", + "schema": { + "$ref": "../definitions.json#/error" + } + }, + "503": { + "description": "Under maintenance", + "schema": { + "$ref": "../definitions.json#/error" + } + } + }, + "x-koha-authorization": { + "permissions": { + "borrowers": "edit_borrowers" + } + } + } + } +} -- 2.11.0