Bugzilla – Attachment 60161 Details for
Bug 18103
REST API: Add endpoint for patron status / blocks
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18103: Add patronstatus to Swagger
Bug-18103-Add-patronstatus-to-Swagger.patch (text/plain), 5.17 KB, created by
Lari Taskula
on 2017-02-13 16:12:05 UTC
(
hide
)
Description:
Bug 18103: Add patronstatus to Swagger
Filename:
MIME Type:
Creator:
Lari Taskula
Created:
2017-02-13 16:12:05 UTC
Size:
5.17 KB
patch
obsolete
>From 3012dd46463d7c2f96195b0c224bc11d7b29ecb7 Mon Sep 17 00:00:00 2001 >From: Lari Taskula <lari.taskula@jns.fi> >Date: Mon, 13 Feb 2017 15:40:33 +0200 >Subject: [PATCH] Bug 18103: Add patronstatus to Swagger > >This patch adds the Swagger definition for patronstatus. > >https://bugs.koha-community.org/show_bug.cgi?id=18103 >--- > api/v1/swagger/definitions.json | 3 ++ > api/v1/swagger/definitions/patronstatus.json | 79 ++++++++++++++++++++++++++++ > api/v1/swagger/paths.json | 3 ++ > api/v1/swagger/paths/patrons.json | 46 ++++++++++++++++ > 4 files changed, 131 insertions(+) > create mode 100644 api/v1/swagger/definitions/patronstatus.json > >diff --git a/api/v1/swagger/definitions.json b/api/v1/swagger/definitions.json >index 3967876..85f180b 100644 >--- a/api/v1/swagger/definitions.json >+++ b/api/v1/swagger/definitions.json >@@ -14,6 +14,9 @@ > "patron": { > "$ref": "definitions/patron.json" > }, >+ "patronstatus": { >+ "$ref": "definitions/patronstatus.json" >+ }, > "holds": { > "$ref": "definitions/holds.json" > }, >diff --git a/api/v1/swagger/definitions/patronstatus.json b/api/v1/swagger/definitions/patronstatus.json >new file mode 100644 >index 0000000..c71e814 >--- /dev/null >+++ b/api/v1/swagger/definitions/patronstatus.json >@@ -0,0 +1,79 @@ >+{ >+ "type": "object", >+ "allOf": [ >+ { "$ref": "../definitions.json#/patron" }, >+ { >+ "type": "object", >+ "properties": { >+ "blocks": { >+ "type": "object", >+ "properties": { >+ "Patron::CardExpired": { >+ "description": "Patron's card has been expired.", >+ "type": "object", >+ "properties": { >+ "expiration_date": { >+ "type": ["string", "null"] >+ } >+ } >+ }, >+ "Patron::CardLost": { >+ "description": "Patron's card has been marked as lost.", >+ "type": "object", >+ "properties": {} >+ }, >+ "Patron::Debarred": { >+ "description": "Patron is debarred.", >+ "type": "object", >+ "properties": { >+ "expiration_date": { >+ "type": ["string", "null"] >+ }, >+ "comment": { >+ "type": ["string", "null"] >+ } >+ } >+ }, >+ "Patron::DebarredOverdue": { >+ "description": "Patron has overdues and is debarred.", >+ "type": "object", >+ "properties": { >+ "number_of_overdues": { >+ "type": ["integer", "null"] >+ } >+ } >+ }, >+ "Patron::Debt": { >+ "description": "Patron's debts exceed maximum allowed amount.", >+ "type": "object", >+ "properties": { >+ "max_outstanding":{ >+ "type": ["number", "null"] >+ }, >+ "current_outstanding": { >+ "type": ["number", "null"] >+ } >+ } >+ }, >+ "Patron::DebtGuarantees": { >+ "description": "Patron's guarantees' debts exceed maximum allowed amount.", >+ "type": "object", >+ "properties": { >+ "max_outstanding":{ >+ "type": ["number", "null"] >+ }, >+ "current_outstanding": { >+ "type": ["number", "null"] >+ } >+ } >+ }, >+ "Patron::GoneNoAddress": { >+ "type": "object", >+ "properties": {} >+ } >+ } >+ } >+ } >+ } >+ ] >+} >diff --git a/api/v1/swagger/paths.json b/api/v1/swagger/paths.json >index 0a914c2..ad52249 100644 >--- a/api/v1/swagger/paths.json >+++ b/api/v1/swagger/paths.json >@@ -31,5 +31,8 @@ > }, > "/patrons/{borrowernumber}": { > "$ref": "paths/patrons.json#/~1patrons~1{borrowernumber}" >+ }, >+ "/patrons/{borrowernumber}/status": { >+ "$ref": "paths/patrons.json#/~1patrons~1{borrowernumber}~1status" > } > } >diff --git a/api/v1/swagger/paths/patrons.json b/api/v1/swagger/paths/patrons.json >index 67632e1..bde2b68 100644 >--- a/api/v1/swagger/paths/patrons.json >+++ b/api/v1/swagger/paths/patrons.json >@@ -69,5 +69,51 @@ > } > } > } >+ }, >+ "/patrons/{borrowernumber}/status": { >+ "get": { >+ "operationId": "getstatusPatron", >+ "tags": ["patrons"], >+ "parameters": [{ >+ "$ref": "../parameters.json#/borrowernumberPathParam" >+ } >+ ], >+ "produces": [ >+ "application/json" >+ ], >+ "responses": { >+ "200": { >+ "description": "A patron", >+ "schema": { >+ "$ref": "../definitions.json#/patronstatus" >+ } >+ }, >+ "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" >+ } >+ } >+ }, >+ "x-koha-authorization": { >+ "allow-owner": true, >+ "allow-guarantor": true, >+ "permissions": { >+ "borrowers": "1" >+ } >+ } >+ } > } > } >-- >1.9.1
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 18103
:
60159
|
60160
| 60161 |
60162