Bugzilla – Attachment 125904 Details for
Bug 28948
Add a /public counterpart for the libraries REST endpoints
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28948: Add GET /public/libraries routes
Bug-28948-Add-GET-publiclibraries-routes.patch (text/plain), 9.24 KB, created by
Tomás Cohen Arazi (tcohen)
on 2021-10-07 18:05:04 UTC
(
hide
)
Description:
Bug 28948: Add GET /public/libraries routes
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2021-10-07 18:05:04 UTC
Size:
9.24 KB
patch
obsolete
>From 9ca3d7279f5f673d3060f2536a4b4e28950baf20 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Thu, 7 Jan 2021 08:50:43 -0300 >Subject: [PATCH] Bug 28948: Add GET /public/libraries routes > >This patch introduces a route to fetch a list of libraries or a single >library as expected on the /public namespace. It is expected to return >the 'public' representation of the Koha::Library objects. > >To test: >1. Apply this patches >2. Run: > $ kshell > k$ prove t/db_dependent/api/v1/libraries.t >=> SUCCESS: Test pass and they cover all the cases! >3. Try your favourite REST tool against the new route. >4. Sign off :-D > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > api/v1/swagger/paths.json | 12 +- > api/v1/swagger/paths/libraries.json | 252 ++++++++++++++++++++++++++++ > 2 files changed, 261 insertions(+), 3 deletions(-) > >diff --git a/api/v1/swagger/paths.json b/api/v1/swagger/paths.json >index 3d3338e0bd..298b411054 100644 >--- a/api/v1/swagger/paths.json >+++ b/api/v1/swagger/paths.json >@@ -92,6 +92,9 @@ > "/libraries": { > "$ref": "paths/libraries.json#/~1libraries" > }, >+ "/libraries/{library_id}": { >+ "$ref": "paths/libraries.json#/~1libraries~1{library_id}" >+ }, > "/transfer_limits": { > "$ref": "paths/transfer_limits.yaml#/~1transfer_limits" > }, >@@ -101,9 +104,6 @@ > "/transfer_limits/batch": { > "$ref": "paths/transfer_limits.yaml#/~1transfer_limits~1batch" > }, >- "/libraries/{library_id}": { >- "$ref": "paths/libraries.json#/~1libraries~1{library_id}" >- }, > "/checkouts/{checkout_id}/allows_renewal": { > "$ref": "paths/checkouts.json#/~1checkouts~1{checkout_id}~1allows_renewal" > }, >@@ -164,6 +164,12 @@ > "/public/biblios/{biblio_id}": { > "$ref": "paths/biblios.json#/~1public~1biblios~1{biblio_id}" > }, >+ "/public/libraries": { >+ "$ref": "paths/libraries.json#/~1public~1libraries" >+ }, >+ "/public/libraries/{library_id}": { >+ "$ref": "paths/libraries.json#/~1public~1libraries~1{library_id}" >+ }, > "/public/patrons/{patron_id}/article_requests/{article_request_id}": { > "$ref": "paths/article_requests.yaml#/~1public~1patrons~1{patron_id}~1article_requests~1{article_request_id}" > }, >diff --git a/api/v1/swagger/paths/libraries.json b/api/v1/swagger/paths/libraries.json >index 6a960eaf7f..e19f616a28 100644 >--- a/api/v1/swagger/paths/libraries.json >+++ b/api/v1/swagger/paths/libraries.json >@@ -431,5 +431,257 @@ > } > } > } >+ }, >+ "/public/libraries": { >+ "get": { >+ "x-mojo-to": "Libraries#list", >+ "operationId": "listLibrariesPublic", >+ "tags": [ >+ "library" >+ ], >+ "summary": "List libraries", >+ "parameters": [ >+ { >+ "name": "name", >+ "in": "query", >+ "description": "Case insensitive 'starts-with' search on name", >+ "required": false, >+ "type": "string" >+ }, >+ { >+ "name": "address1", >+ "in": "query", >+ "description": "Case insensitive 'starts-with' search on address1", >+ "required": false, >+ "type": "string" >+ }, >+ { >+ "name": "address2", >+ "in": "query", >+ "description": "Case insensitive 'starts-with' search on address2", >+ "required": false, >+ "type": "string" >+ }, >+ { >+ "name": "address3", >+ "in": "query", >+ "description": "Case insensitive 'starts-with' search on address3", >+ "required": false, >+ "type": "string" >+ }, >+ { >+ "name": "postal_code", >+ "in": "query", >+ "description": "Case insensitive 'starts-with' search on postal code", >+ "required": false, >+ "type": "string" >+ }, >+ { >+ "name": "city", >+ "in": "query", >+ "description": "Case insensitive 'starts-with' search on city", >+ "required": false, >+ "type": "string" >+ }, >+ { >+ "name": "state", >+ "in": "query", >+ "description": "Case insensitive 'starts-with' search on state", >+ "required": false, >+ "type": "string" >+ }, >+ { >+ "name": "country", >+ "in": "query", >+ "description": "Case insensitive 'starts_with' search on country", >+ "required": false, >+ "type": "string" >+ }, >+ { >+ "name": "phone", >+ "in": "query", >+ "description": "Case insensitive 'starts_with' search on phone number", >+ "required": false, >+ "type": "string" >+ }, >+ { >+ "name": "fax", >+ "in": "query", >+ "description": "Case insensitive 'starts_with' search on fax number", >+ "required": false, >+ "type": "string" >+ }, >+ { >+ "name": "email", >+ "in": "query", >+ "description": "Case insensitive 'starts_with' search on email address", >+ "required": false, >+ "type": "string" >+ }, >+ { >+ "name": "reply_to_email", >+ "in": "query", >+ "description": "Case insensitive 'starts_with' search on Reply-To email address", >+ "required": false, >+ "type": "string" >+ }, >+ { >+ "name": "return_path_email", >+ "in": "query", >+ "description": "Case insensitive 'starts_with' search on Return-Path email address", >+ "required": false, >+ "type": "string" >+ }, >+ { >+ "name": "url", >+ "in": "query", >+ "description": "Case insensitive 'starts_with' search on website URL", >+ "required": false, >+ "type": "string" >+ }, >+ { >+ "name": "ip", >+ "in": "query", >+ "description": "Case insensitive 'starts_with' search on IP address", >+ "required": false, >+ "type": "string" >+ }, >+ { >+ "name": "notes", >+ "in": "query", >+ "description": "Case insensitive 'starts_with' search on notes", >+ "required": false, >+ "type": "string" >+ }, >+ { >+ "name": "opac_info", >+ "in": "query", >+ "description": "Case insensitive 'starts-with' search on OPAC info", >+ "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" >+ } >+ ], >+ "produces": [ >+ "application/json" >+ ], >+ "responses": { >+ "200": { >+ "description": "A list of libraries", >+ "schema": { >+ "type": "array", >+ "items": { >+ "$ref": "../definitions.json#/library" >+ } >+ } >+ }, >+ "500": { >+ "description": "Internal error", >+ "schema": { >+ "$ref": "../definitions.json#/error" >+ } >+ }, >+ "503": { >+ "description": "Under maintenance", >+ "schema": { >+ "$ref": "../definitions.json#/error" >+ } >+ } >+ }, >+ "x-koha-authorization": { >+ "permissions": { >+ "catalogue": "1" >+ } >+ }, >+ "x-koha-embed": [ >+ "smtp_server" >+ ] >+ } >+ }, >+ "/public/libraries/{library_id}": { >+ "get": { >+ "x-mojo-to": "Libraries#get_public", >+ "operationId": "getLibraryPublic", >+ "tags": [ >+ "libraries" >+ ], >+ "summary": "Get library (public)", >+ "parameters": [ >+ { >+ "$ref": "../parameters.json#/library_id_pp" >+ } >+ ], >+ "produces": [ >+ "application/marcxml+xml", >+ "application/marc-in-json", >+ "application/marc", >+ "text/plain" >+ ], >+ "responses": { >+ "200": { >+ "description": "A library" >+ }, >+ "401": { >+ "description": "Authentication required", >+ "schema": { >+ "$ref": "../definitions.json#/error" >+ } >+ }, >+ "403": { >+ "description": "Access forbidden", >+ "schema": { >+ "$ref": "../definitions.json#/error" >+ } >+ }, >+ "404": { >+ "description": "Library not found", >+ "schema": { >+ "$ref": "../definitions.json#/error" >+ } >+ }, >+ "406": { >+ "description": "Not acceptable", >+ "schema": { >+ "type": "array", >+ "description": "Accepted content-types", >+ "items": { >+ "type": "string" >+ } >+ } >+ }, >+ "500": { >+ "description": "Internal server error", >+ "schema": { >+ "$ref": "../definitions.json#/error" >+ } >+ }, >+ "503": { >+ "description": "Under maintenance", >+ "schema": { >+ "$ref": "../definitions.json#/error" >+ } >+ } >+ } >+ } > } > } >-- >2.33.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 28948
:
124479
|
124480
|
124481
|
124482
|
124483
|
124749
|
124911
|
124914
|
125901
|
125902
|
125903
|
125904
|
125905
|
125906
|
125907
|
125908
|
125911
|
125912
|
126111
|
126112
|
126113
|
126114
|
126115
|
126116
|
126117
|
126118
|
126119
|
126120
|
126121
|
126122
|
126123
|
126124
|
126125
|
126126
|
127054
|
127055