Bugzilla – Attachment 47843 Details for
Bug 15126
REST API: Use newer version of Swagger2
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Big splitted swagger2 spec. Example of the planned usage pattern.
0001-Bug-13799-REST-API-Introducing-a-splitted-Swagger-sp.patch (text/plain), 92.87 KB, created by
Olli-Antti Kivilahti
on 2016-02-10 12:53:59 UTC
(
hide
)
Description:
Big splitted swagger2 spec. Example of the planned usage pattern.
Filename:
MIME Type:
Creator:
Olli-Antti Kivilahti
Created:
2016-02-10 12:53:59 UTC
Size:
92.87 KB
patch
obsolete
>From f2db50c113dac4d804705abe11af96b645a9e162 Mon Sep 17 00:00:00 2001 >From: Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> >Date: Wed, 10 Feb 2016 14:25:34 +0200 >Subject: [PATCH 1/4] Bug 13799 - REST API - Introducing a splitted > Swagger-spec > >Our massive Swagger2-spec was split to several smaller files and a lot >of validation errors were fixed using minifySwagger.pl. > >INSTALLATION: > >-Note the changes in the Apache2 reverse proxying. >-swagger.json is moved to swagger/swagger.min.json and the minified version is > created using the minifySwagger.pl -script >--- > Koha/REST/V1.pm | 2 +- > api/v1/swagger/definitions.json | 59 +++++ > api/v1/swagger/definitions/borrower.json | 20 ++ > api/v1/swagger/definitions/borrowerStatus.json | 88 ++++++++ > api/v1/swagger/definitions/error.json | 9 + > api/v1/swagger/definitions/hold.json | 69 ++++++ > api/v1/swagger/definitions/listContent.json | 9 + > api/v1/swagger/definitions/message.json | 56 +++++ > .../swagger/definitions/newBorrowerHoldBody.json | 27 +++ > api/v1/swagger/definitions/session.json | 17 ++ > api/v1/swagger/definitions/testedSession.json | 10 + > api/v1/swagger/info.json | 12 + > api/v1/swagger/parameters.json | 133 +++++++++++ > api/v1/swagger/paths.json | 50 +++++ > api/v1/swagger/paths/auth.json | 34 +++ > api/v1/swagger/paths/biblios.json | 45 ++++ > api/v1/swagger/paths/borrowers.json | 180 +++++++++++++++ > api/v1/swagger/paths/labels.json | 241 ++++++++++++++++++++ > api/v1/swagger/paths/lists.json | 50 +++++ > api/v1/swagger/paths/messages.json | 244 +++++++++++++++++++++ > api/v1/swagger/paths/serials.json | 74 +++++++ > api/v1/swagger/securityDefinitions.json | 8 + > api/v1/swagger/swagger.json | 20 ++ > api/v1/swagger/swagger.min.json | 1 + > etc/koha-httpd.conf | 10 +- > 25 files changed, 1461 insertions(+), 7 deletions(-) > create mode 100644 api/v1/swagger/definitions.json > create mode 100644 api/v1/swagger/definitions/borrower.json > create mode 100644 api/v1/swagger/definitions/borrowerStatus.json > create mode 100644 api/v1/swagger/definitions/error.json > create mode 100644 api/v1/swagger/definitions/hold.json > create mode 100644 api/v1/swagger/definitions/listContent.json > create mode 100644 api/v1/swagger/definitions/message.json > create mode 100644 api/v1/swagger/definitions/newBorrowerHoldBody.json > create mode 100644 api/v1/swagger/definitions/session.json > create mode 100644 api/v1/swagger/definitions/testedSession.json > create mode 100644 api/v1/swagger/info.json > create mode 100644 api/v1/swagger/parameters.json > create mode 100644 api/v1/swagger/paths.json > create mode 100644 api/v1/swagger/paths/auth.json > create mode 100644 api/v1/swagger/paths/biblios.json > create mode 100644 api/v1/swagger/paths/borrowers.json > create mode 100644 api/v1/swagger/paths/labels.json > create mode 100644 api/v1/swagger/paths/lists.json > create mode 100644 api/v1/swagger/paths/messages.json > create mode 100644 api/v1/swagger/paths/serials.json > create mode 100644 api/v1/swagger/securityDefinitions.json > create mode 100644 api/v1/swagger/swagger.json > create mode 100644 api/v1/swagger/swagger.min.json > >diff --git a/Koha/REST/V1.pm b/Koha/REST/V1.pm >index 4de2b28..116dc7a 100644 >--- a/Koha/REST/V1.pm >+++ b/Koha/REST/V1.pm >@@ -72,7 +72,7 @@ sub startup { > $self->types->type(json => 'application/json; charset=utf8'); > > $self->plugin(Swagger2 => { >- url => $self->home->rel_file("api/v1/swagger.json"), >+ url => $self->home->rel_file("api/v1/swagger/swagger.min.json"), > }); > } > >diff --git a/api/v1/swagger/definitions.json b/api/v1/swagger/definitions.json >new file mode 100644 >index 0000000..72ecec5 >--- /dev/null >+++ b/api/v1/swagger/definitions.json >@@ -0,0 +1,59 @@ >+{ >+ "borrower": { >+ "$ref": "definitions/borrower.json" >+ }, >+ "listContent": { >+ "$ref": "definitions/listContent.json" >+ }, >+ "holds": { >+ "type": "array", >+ "items": {"$ref": "definitions/hold.json"} >+ }, >+ "hold": { >+ "$ref": "definitions/hold.json" >+ }, >+ "newBorrowerHoldBody": { >+ "$ref": "definitions/newBorrowerHoldBody.json" >+ }, >+ "borrowerStatus": { >+ "$ref": "definitions/borrowerStatus.json" >+ }, >+ "session": { >+ "$ref": "definitions/session.json" >+ }, >+ "testedSession": { >+ "$ref": "definitions/testedSession.json" >+ }, >+ "message": { >+ "$ref": "definitions/message.json" >+ }, >+ "error": { >+ "$ref": "definitions/error.json" >+ }, >+ >+ >+ "biblionumber": { >+ "type": "integer", >+ "description": "Biblio internal identifier" >+ }, >+ "borrowernumber": { >+ "type": "integer", >+ "description": "Borrower internal identifier" >+ }, >+ "branchcode": { >+ "type": "string", >+ "description": "Code identifying a library" >+ }, >+ "cardnumber": { >+ "description": "Library assigned ID number for Borrowers", >+ "type": "string" >+ }, >+ "itemnumber": { >+ "type": "integer", >+ "description": "Item internal identifier" >+ }, >+ "listContentNumber": { >+ "type": "integer", >+ "description": "The internal identifier for this list article" >+ } >+} >\ No newline at end of file >diff --git a/api/v1/swagger/definitions/borrower.json b/api/v1/swagger/definitions/borrower.json >new file mode 100644 >index 0000000..36c118c >--- /dev/null >+++ b/api/v1/swagger/definitions/borrower.json >@@ -0,0 +1,20 @@ >+{ >+ "type": "object", >+ "properties": { >+ "borrowernumber": { >+ "$ref": "../definitions.json#/borrowernumber" >+ }, >+ "cardnumber": { >+ "description": "library assigned ID number for borrowers", >+ "type": "string" >+ }, >+ "surname": { >+ "description": "borrower's last name", >+ "type": "string" >+ }, >+ "firstname": { >+ "description": "borrower's first name", >+ "type": "string" >+ } >+ } >+} >\ No newline at end of file >diff --git a/api/v1/swagger/definitions/borrowerStatus.json b/api/v1/swagger/definitions/borrowerStatus.json >new file mode 100644 >index 0000000..8ce56c3 >--- /dev/null >+++ b/api/v1/swagger/definitions/borrowerStatus.json >@@ -0,0 +1,88 @@ >+{ >+ "type": "object", >+ "properties": { >+ "borrowernumber": { >+ "$ref": "../definitions.json#/borrowernumber" >+ }, >+ "cardnumber": { >+ "$ref": "../definitions.json#/cardnumber" >+ }, >+ "surname": { >+ "description": "Last name", >+ "type": "string" >+ }, >+ "firstname": { >+ "description": "First name", >+ "type": "string" >+ }, >+ "homebranch": { >+ "description": "Home library/branch.", >+ "type": "string" >+ }, >+ "fines": { >+ "description": "Total due fines", >+ "type": "number", >+ "format": "double" >+ }, >+ "language": { >+ "description": "Desired language of service", >+ "type": "string" >+ }, >+ "charge_privileges_denied": { >+ "description": "", >+ "type": "boolean" >+ }, >+ "renewal_privileges_denied": { >+ "description": "", >+ "type": "boolean" >+ }, >+ "recall_privileges_denied": { >+ "description": "", >+ "type": "boolean" >+ }, >+ "hold_privileges_denied": { >+ "description": "", >+ "type": "boolean" >+ }, >+ "card_reported_lost": { >+ "description": "", >+ "type": "boolean" >+ }, >+ "too_many_items_charged": { >+ "description": "", >+ "type": "boolean" >+ }, >+ "too_many_items_overdue": { >+ "description": "", >+ "type": "boolean" >+ }, >+ "too_many_renewals": { >+ "description": "", >+ "type": "boolean" >+ }, >+ "too_many_claims_of_items_returned": { >+ "description": "", >+ "type": "boolean" >+ }, >+ "too_many_items_lost": { >+ "description": "", >+ "type": "boolean" >+ }, >+ "excessive_outstanding_fines": { >+ "description": "", >+ "type": "boolean" >+ }, >+ "excessive_outstanding_fees": { >+ "description": "", >+ "type": "boolean" >+ }, >+ "recall_overdue": { >+ "description": "", >+ "type": "boolean" >+ }, >+ "too_many_items_billed": { >+ "description": "", >+ "type": "boolean" >+ } >+ } >+} >\ No newline at end of file >diff --git a/api/v1/swagger/definitions/error.json b/api/v1/swagger/definitions/error.json >new file mode 100644 >index 0000000..3e70bd3 >--- /dev/null >+++ b/api/v1/swagger/definitions/error.json >@@ -0,0 +1,9 @@ >+{ >+ "type": "object", >+ "properties": { >+ "error": { >+ "description": "Error message", >+ "type": "string" >+ } >+ } >+} >\ No newline at end of file >diff --git a/api/v1/swagger/definitions/hold.json b/api/v1/swagger/definitions/hold.json >new file mode 100644 >index 0000000..458b522 >--- /dev/null >+++ b/api/v1/swagger/definitions/hold.json >@@ -0,0 +1,69 @@ >+{ >+ "type": "object", >+ "properties": { >+ "reserve_id": { >+ "description": "Internal reserve identifier", >+ "type": "number" >+ }, >+ "borrowernumber": { "$ref" : "../definitions.json#/borrowernumber" }, >+ "reservedate": { >+ "description": "the date the reserve was placed", >+ "type": "string" >+ }, >+ "biblionumber": { "$ref": "../definitions.json#/biblionumber" }, >+ "constrainttype": { >+ "description": "type of constraint", >+ "type": "string" >+ }, >+ "branchcode": { "$ref": "../definitions.json#/branchcode" }, >+ "notificationdate": { >+ "description": "currently unused", >+ "type": "string" >+ }, >+ "reminderdate": { >+ "description": "currently unused", >+ "type": "string" >+ }, >+ "cancellationdate": { >+ "description": "the date the reserve was cancelled", >+ "type": "string" >+ }, >+ "reservenotes": { >+ "description": "notes related to this reserve", >+ "type": "string" >+ }, >+ "priority": { >+ "description": "where in the queue the patron sits", >+ "type": "string" >+ }, >+ "found": { >+ "description": "a one letter code defining what the status of the reserve is after it has been confirmed", >+ "type": "string" >+ }, >+ "timestamp": { >+ "description": "date and time the reserve was last updated", >+ "type": "string" >+ }, >+ "itemnumber": { "$ref": "../definitions.json#/itemnumber" }, >+ "waitingdate": { >+ "description": "the date the item was marked as waiting for the patron at the library", >+ "type": "string" >+ }, >+ "expirationdate": { >+ "description": "the date the reserve expires", >+ "type": "string" >+ }, >+ "lowestPriority": { >+ "description": "", >+ "type": "string" >+ }, >+ "suspend": { >+ "description": "", >+ "type": "string" >+ }, >+ "suspend_until": { >+ "description": "", >+ "type": "string" >+ } >+ } >+} >\ No newline at end of file >diff --git a/api/v1/swagger/definitions/listContent.json b/api/v1/swagger/definitions/listContent.json >new file mode 100644 >index 0000000..65215cd >--- /dev/null >+++ b/api/v1/swagger/definitions/listContent.json >@@ -0,0 +1,9 @@ >+{ >+ "type": "object", >+ "properties": { >+ "listContentNumber": { "$ref": "../definitions.json#/listContentNumber" }, >+ "biblionumber": { "$ref": "../definitions.json#/biblionumber" }, >+ "itemnumber": { "$ref": "../definitions.json#/itemnumber" }, >+ "borrowernumber": { "$ref" : "../definitions.json#/borrowernumber" } >+ } >+} >\ No newline at end of file >diff --git a/api/v1/swagger/definitions/message.json b/api/v1/swagger/definitions/message.json >new file mode 100644 >index 0000000..d10298b >--- /dev/null >+++ b/api/v1/swagger/definitions/message.json >@@ -0,0 +1,56 @@ >+{ >+ "type": "object", >+ "properties": { >+ "message_id": { >+ "description": "Message internal identifier", >+ "type": "integer" >+ }, >+ "time_queued": { >+ "description": "Date and time of when message was placed in queue", >+ "type": "string" >+ }, >+ "borrowernumber": { >+ "$ref": "../definitions.json#/borrowernumber" >+ }, >+ "subject": { >+ "description": "Subject of the message", >+ "type": "string" >+ }, >+ "content": { >+ "description": "Content of the message", >+ "type": "string" >+ }, >+ "metadata": { >+ "description": "", >+ "type": "string" >+ }, >+ "letter_code": { >+ "description": "", >+ "type": "string" >+ }, >+ "content_type": { >+ "description": "Content type", >+ "type": "string" >+ }, >+ "message_transport_type": { >+ "description": "Transport method. Values accepted by default are 'email', 'sms', 'phone' and 'print'", >+ "type": "string" >+ }, >+ "status": { >+ "description": "Delivery status", >+ "type": "string" >+ }, >+ "to_address": { >+ "description": "Destination email address", >+ "type": "string" >+ }, >+ "from_address": { >+ "description": "Source address of email", >+ "type": "string" >+ }, >+ "delivery_note": { >+ "description": "Additional delivery notes", >+ "type": "string" >+ } >+ } >+} >\ No newline at end of file >diff --git a/api/v1/swagger/definitions/newBorrowerHoldBody.json b/api/v1/swagger/definitions/newBorrowerHoldBody.json >new file mode 100644 >index 0000000..f23f6e5 >--- /dev/null >+++ b/api/v1/swagger/definitions/newBorrowerHoldBody.json >@@ -0,0 +1,27 @@ >+{ >+ "type": "object", >+ "properties": { >+ "biblionumber": { >+ "description": "Biblio internal identifier", >+ "type": "integer" >+ }, >+ "itemnumber": { >+ "description": "Item internal identifier", >+ "type": "integer" >+ }, >+ "branchcode": { >+ "description": "Pickup location", >+ "type": "string" >+ }, >+ "expirationdate": { >+ "description": "Reserve end date", >+ "type": "string", >+ "format": "date" >+ }, >+ "suspend_until": { >+ "description": "Suspend the Hold until this date, so the Hold won't get caught but advances in queue.", >+ "type": "string", >+ "format": "date" >+ } >+ } >+} >\ No newline at end of file >diff --git a/api/v1/swagger/definitions/session.json b/api/v1/swagger/definitions/session.json >new file mode 100644 >index 0000000..b3e32e6 >--- /dev/null >+++ b/api/v1/swagger/definitions/session.json >@@ -0,0 +1,17 @@ >+{ >+ "type": "object", >+ "properties": { >+ "email": { >+ "description": "borrower's primary email address", >+ "type": "string" >+ }, >+ "lastname": { >+ "description": "borrower's last name", >+ "type": "string" >+ }, >+ "firstname": { >+ "description": "borrower's first name", >+ "type": "string" >+ } >+ } >+} >\ No newline at end of file >diff --git a/api/v1/swagger/definitions/testedSession.json b/api/v1/swagger/definitions/testedSession.json >new file mode 100644 >index 0000000..80c79ce >--- /dev/null >+++ b/api/v1/swagger/definitions/testedSession.json >@@ -0,0 +1,10 @@ >+{ >+ "type": "object", >+ "properties": { >+ "sessionid": { >+ "description": "The Koha sessionid to be tested", >+ "type": "string" >+ } >+ }, >+ "required": ["sessionid"] >+} >\ No newline at end of file >diff --git a/api/v1/swagger/info.json b/api/v1/swagger/info.json >new file mode 100644 >index 0000000..dec71a2 >--- /dev/null >+++ b/api/v1/swagger/info.json >@@ -0,0 +1,12 @@ >+{ >+ "title": "Koha REST API", >+ "version": "1", >+ "license": { >+ "name": "GPL v3", >+ "url": "http://www.gnu.org/licenses/gpl.txt" >+ }, >+ "contact": { >+ "name": "Koha Team", >+ "url": "http://koha-community.org/" >+ } >+} >diff --git a/api/v1/swagger/parameters.json b/api/v1/swagger/parameters.json >new file mode 100644 >index 0000000..1ac7fa4 >--- /dev/null >+++ b/api/v1/swagger/parameters.json >@@ -0,0 +1,133 @@ >+{ >+ "biblionumberPathParam": { >+ "name": "biblionumber", >+ "in": "path", >+ "description": "Internal biblio identifier", >+ "required": true, >+ "type": "integer" >+ }, >+ "biblionumberQueryParam": { >+ "name": "biblionumber", >+ "in": "query", >+ "description": "Internal biblio identifier", >+ "required": true, >+ "type": "integer" >+ }, >+ "borrowernumberPathParam": { >+ "name": "borrowernumber", >+ "in": "path", >+ "description": "Internal borrower identifier", >+ "required": true, >+ "type": "integer" >+ }, >+ "listnamePathParam": { >+ "name": "listname", >+ "in": "path", >+ "description": "list name", >+ "required": true, >+ "type": "string" >+ }, >+ "listContent": { >+ "name": "listContent", >+ "description": "The list article", >+ "in": "body", >+ "required": true, >+ "schema" : { >+ "$ref": "definitions/listContent.json" >+ } >+ }, >+ "holdingbranchQueryParam": { >+ "name": "holdingbranch", >+ "in": "query", >+ "description": "The code of the branch where the Items have been last seen.", >+ "required": false, >+ "type": "string" >+ }, >+ "messagenumberPathParam": { >+ "name": "messagenumber", >+ "in": "path", >+ "description": "Internal message identifier", >+ "required": true, >+ "type": "integer" >+ }, >+ "sheet_identifierPathParam": { >+ "name": "sheet_identifier", >+ "in": "path", >+ "description": "Internal sheet identifier", >+ "required": true, >+ "type": "integer" >+ }, >+ "sheet_versionPathParam": { >+ "name": "sheet_version", >+ "in": "path", >+ "description": "Sheet version number. If omitted, operations target the newest version. Set to '631373.00' to affect all versions.", >+ "type": "number", >+ "format": "float", >+ "required": true >+ }, >+ "session": { >+ "name": "session", >+ "description": "The CGISESSID Cookie used to authenticate a session", >+ "in": "body", >+ "required": true, >+ "schema" : { >+ "$ref": "definitions/testedSession.json" >+ } >+ }, >+ "borrowernumberQueryParam": { >+ "name": "borrowernumber", >+ "in": "query", >+ "description": "The internal id of the Borrower, unique value", >+ "required": false, >+ "type": "integer" >+ }, >+ "useridQueryParam": { >+ "name": "userid", >+ "in": "query", >+ "description": "The userid of the Borrower, unique value", >+ "required": false, >+ "type": "string" >+ }, >+ "cardnumberQueryParam": { >+ "name": "cardnumber", >+ "in": "query", >+ "description": "The cardnumber of the Borrower, unique value", >+ "required": false, >+ "type": "string" >+ }, >+ "pattern_xQueryParam": { >+ "name": "pattern_x", >+ "in": "query", >+ "description": "The first serial issue enumeration field, typically the year.", >+ "required": false, >+ "type": "string" >+ }, >+ "pattern_yQueryParam": { >+ "name": "pattern_y", >+ "in": "query", >+ "description": "the second enumeration, eg volume.", >+ "required": false, >+ "type": "string" >+ }, >+ "pattern_zQueryParam": { >+ "name": "pattern_z", >+ "in": "query", >+ "description": "the third enumeration field.", >+ "required": false, >+ "type": "string" >+ }, >+ "serialStatusQueryParam": { >+ "name": "serialStatus", >+ "in": "query", >+ "description": "Status of a serial. 1 = Expected, 2 = Received, 3 = Late, 4 = Not issued, 7 = Claimed.", >+ "required": false, >+ "type": "integer" >+ }, >+ "limitQueryParam": { >+ "name": "limit", >+ "in": "query", >+ "description": "Limit the resultset to this many results.", >+ "required": false, >+ "type": "integer" >+ } >+} >\ No newline at end of file >diff --git a/api/v1/swagger/paths.json b/api/v1/swagger/paths.json >new file mode 100644 >index 0000000..a5327c5 >--- /dev/null >+++ b/api/v1/swagger/paths.json >@@ -0,0 +1,50 @@ >+{ >+ "/serialitems": { >+ "$ref": "paths/serials.json#/~1serialitems" >+ }, >+ "/serials/collection": { >+ "$ref": "paths/serials.json#/~1serials~1collection" >+ }, >+ "/biblios/{biblionumber}": { >+ "$ref": "paths/biblios.json#/~1biblios~1{biblionumber}" >+ }, >+ "/borrowers": { >+ "$ref": "paths/borrowers.json#/~1borrowers" >+ }, >+ "/borrowers/status": { >+ "$ref": "paths/borrowers.json#/~1borrowers~1status" >+ }, >+ "/borrowers/{borrowernumber}": { >+ "$ref": "paths/borrowers.json#/~1borrowers~1{borrowernumber}" >+ }, >+ "/borrowers/{borrowernumber}/holds": { >+ "$ref": "paths/borrowers.json#/~1borrowers~1{borrowernumber}~1holds" >+ }, >+ "/lists/{listname}/contents": { >+ "$ref": "paths/lists.json#/~1lists~1{listname}~1contents" >+ }, >+ "/auth/session": { >+ "$ref": "paths/auth.json#/~1auth~1session" >+ }, >+ "/messages": { >+ "$ref": "paths/messages.json#/~1messages" >+ }, >+ "/messages/{messagenumber}": { >+ "$ref": "paths/messages.json#/~1messages~1{messagenumber}" >+ }, >+ "/messages/{messagenumber}/resend": { >+ "$ref": "paths/messages.json#/~1messages~1{messagenumber}~1resend" >+ }, >+ "/messages/{messagenumber}/report/labyrintti": { >+ "$ref": "paths/messages.json#/~1messages~1{messagenumber}~1report~1labyrintti" >+ }, >+ "/labels/sheets": { >+ "$ref": "paths/labels.json#/~1labels~1sheets" >+ }, >+ "/labels/sheets/version": { >+ "$ref": "paths/labels.json#/~1labels~1sheets~1version" >+ }, >+ "/labels/sheets/{sheet_identifier}/{sheet_version}": { >+ "$ref": "paths/labels.json#/~1labels~1sheets~1{sheet_identifier}~1{sheet_version}" >+ } >+} >\ No newline at end of file >diff --git a/api/v1/swagger/paths/auth.json b/api/v1/swagger/paths/auth.json >new file mode 100644 >index 0000000..664997d >--- /dev/null >+++ b/api/v1/swagger/paths/auth.json >@@ -0,0 +1,34 @@ >+{ >+ "/auth/session": { >+ "get": { >+ "x-mojo-controller": "Koha::REST::V1::Auth", >+ "x-koha-permission": { >+ "auth": "get_session" >+ }, >+ "operationId": "getSession", >+ "tags": ["auth"], >+ "parameters": [ >+ { >+ "$ref": "../parameters.json#/session" >+ } >+ ], >+ "produces": [ >+ "application/json" >+ ], >+ "responses": { >+ "200": { >+ "description": "A borrower with SSO-relevant fields", >+ "schema": { >+ "$ref": "../definitions/session.json" >+ } >+ }, >+ "404": { >+ "description": "Session not found", >+ "schema": { >+ "$ref": "../definitions/error.json" >+ } >+ } >+ } >+ } >+ } >+} >\ No newline at end of file >diff --git a/api/v1/swagger/paths/biblios.json b/api/v1/swagger/paths/biblios.json >new file mode 100644 >index 0000000..fc58631 >--- /dev/null >+++ b/api/v1/swagger/paths/biblios.json >@@ -0,0 +1,45 @@ >+{ >+ "/biblios/{biblionumber}": { >+ "delete": { >+ "x-mojo-controller": "Koha::REST::V1::Biblios", >+ "x-koha-permission": { >+ "editcatalogue": "delete_catalogue" >+ }, >+ "operationId": "deleteBiblio", >+ "tags": ["biblios"], >+ "summary": "Deletes the given Bibliographic Record", >+ "description": "Can fail if there are dependecies to the Biblio.", >+ "produces": [ >+ "" >+ ], >+ "parameters": [ >+ { >+ "$ref": "../parameters.json#/biblionumberPathParam" >+ } >+ ], >+ "responses": { >+ "204": { >+ "description": "Deleting the Record succeeded.", >+ "schema": { >+ "type": "string" >+ } >+ }, >+ "404": { >+ "description": "No such Bibliographic record found", >+ "schema": { >+ "$ref": "../definitions/error.json" >+ } >+ }, >+ "400": { >+ "description": "Cannot delete the Bibliographic Record due to constraints. A constraint can be for example the presence of dependant Items.", >+ "schema": { >+ "$ref": "../definitions/error.json" >+ } >+ } >+ }, >+ "security": [ >+ { "multi_key_auth": [] } >+ ] >+ } >+ } >+} >\ No newline at end of file >diff --git a/api/v1/swagger/paths/borrowers.json b/api/v1/swagger/paths/borrowers.json >new file mode 100644 >index 0000000..f3082a9 >--- /dev/null >+++ b/api/v1/swagger/paths/borrowers.json >@@ -0,0 +1,180 @@ >+{ >+ "/borrowers": { >+ "get": { >+ "x-mojo-controller": "Koha::REST::V1::Borrowers", >+ "x-koha-permission": { >+ "borrowers": "*" >+ }, >+ "operationId": "listBorrowers", >+ "tags": ["borrowers"], >+ "summary": "Searches for Borrowers", >+ "description": "Search borrowers from Koha, optionally filter the search with specific parameters. All parameters given, must be present in the returned Borrower-objects. If no search parameters are given, all borrowers are returned! This is certainly not what you want.", >+ "produces": [ >+ "application/json" >+ ], >+ "parameters": [ >+ { "$ref": "../parameters.json#/cardnumberQueryParam" }, >+ { "$ref": "../parameters.json#/useridQueryParam" }, >+ { "$ref": "../parameters.json#/borrowernumberQueryParam" } >+ ], >+ "responses": { >+ "200": { >+ "description": "A list of borrowers", >+ "schema": { >+ "type": "array", >+ "items": { >+ "$ref": "../definitions/borrower.json" >+ } >+ } >+ } >+ }, >+ "security": [ >+ { "multi_key_auth": [] } >+ ] >+ } >+ }, >+ "/borrowers/status": { >+ "get": { >+ "x-mojo-controller": "Koha::REST::V1::Borrowers", >+ "operationId": "status", >+ "tags": ["borrowers"], >+ "summary": "Returns the Borrower's details and statuses", >+ "description": "This endpoint doesn't need other authentication than the proper username and password, and can be used anonymously.<br/>Note: Does not authenticate the Borrower to Koha!", >+ "produces": [ >+ "application/json", >+ "application/xml" >+ ], >+ "parameters": [ >+ { >+ "name": "uname", >+ "description": "The Username the Borrower uses to authenticate", >+ "in": "formData", >+ "required": true, >+ "type": "string" >+ }, >+ { >+ "name": "passwd", >+ "description": "The Password the Borrower uses to authenticate", >+ "in": "formData", >+ "required": true, >+ "type": "string" >+ } >+ ], >+ "responses": { >+ "200": { >+ "description": "Borrower information", >+ "schema": { >+ "$ref": "../definitions.json#/borrowerStatus" >+ } >+ }, >+ "400": { >+ "description": "Password authentication failed using username or password", >+ "schema": { >+ "$ref": "../definitions/error.json" >+ } >+ } >+ } >+ } >+ }, >+ "/borrowers/{borrowernumber}": { >+ "get": { >+ "x-mojo-controller": "Koha::REST::V1::Borrowers", >+ "x-koha-permission": { >+ "borrowers": "*" >+ }, >+ "operationId": "getBorrower", >+ "tags": ["borrowers"], >+ "parameters": [ >+ { >+ "$ref": "../parameters.json#/borrowernumberPathParam" >+ } >+ ], >+ "produces": [ >+ "application/json" >+ ], >+ "responses": { >+ "200": { >+ "description": "A borrower", >+ "schema": { >+ "$ref": "../definitions/borrower.json" >+ } >+ }, >+ "404": { >+ "description": "Borrower not found", >+ "schema": { >+ "$ref": "../definitions/error.json" >+ } >+ } >+ }, >+ "security": [ >+ { "multi_key_auth": [] } >+ ] >+ } >+ }, >+ "/borrowers/{borrowernumber}/holds": { >+ "get": { >+ "x-mojo-controller": "Koha::REST::V1::Borrowers::Holds", >+ "x-koha-permission": { >+ "borrowers": "*" >+ }, >+ "operationId": "listBorrowerHolds", >+ "tags": ["borrowers", "holds"], >+ "parameters": [ >+ { "$ref": "../parameters.json#/borrowernumberPathParam" } >+ ], >+ "produces": ["application/json"], >+ "responses": { >+ "200": { >+ "description": "A list of holds", >+ "schema": { "$ref": "../definitions.json#/holds" } >+ }, >+ "404": { >+ "description": "Borrower not found", >+ "schema": { "$ref": "../definitions/error.json" } >+ } >+ } >+ }, >+ "post": { >+ "x-mojo-controller": "Koha::REST::V1::Borrowers::Holds", >+ "x-koha-permission": { >+ "circulate": "*" >+ }, >+ "operationId": "addBorrowerHold", >+ "tags": ["borrowers", "holds"], >+ "parameters": [ >+ { "$ref": "../parameters.json#/borrowernumberPathParam" }, >+ { >+ "name": "body", >+ "in": "body", >+ "description": "A Hold-object", >+ "required": true, >+ "schema": { "$ref": "../definitions/newBorrowerHoldBody.json" } >+ } >+ ], >+ "consumes": ["application/json"], >+ "produces": ["application/json"], >+ "responses": { >+ "201": { >+ "description": "Created hold", >+ "schema": { "$ref": "../definitions/hold.json" } >+ }, >+ "400": { >+ "description": "Missing or wrong parameters", >+ "schema": { "$ref": "../definitions/error.json" } >+ }, >+ "403": { >+ "description": "Hold not allowed", >+ "schema": { "$ref": "../definitions/error.json" } >+ }, >+ "404": { >+ "description": "Borrower not found", >+ "schema": { "$ref": "../definitions/error.json" } >+ }, >+ "500": { >+ "description": "Internal error", >+ "schema": { "$ref": "../definitions/error.json" } >+ } >+ } >+ } >+ } >+} >\ No newline at end of file >diff --git a/api/v1/swagger/paths/labels.json b/api/v1/swagger/paths/labels.json >new file mode 100644 >index 0000000..f0bc697 >--- /dev/null >+++ b/api/v1/swagger/paths/labels.json >@@ -0,0 +1,241 @@ >+{ >+ "/labels/sheets": { >+ "get": { >+ "x-mojo-controller": "Koha::REST::V1::Labels::Sheets", >+ "operationId": "listSheets", >+ "x-koha-permission": { >+ "labels": "sheets_get" >+ }, >+ "tags": ["labels"], >+ "produces": [ >+ "application/json" >+ ], >+ "summary": "Get a list of label positioning sheets.", >+ "description": "Not designed for external use. Use this to see the structure of the sheet-objects.", >+ "responses": { >+ "200": { >+ "description": "A list of sheets", >+ "schema": { >+ "type": "array", >+ "items": { >+ "type": "string" >+ } >+ } >+ }, >+ "404": { >+ "description": "No sheets in Koha", >+ "schema": { >+ "$ref": "../definitions/error.json" >+ } >+ }, >+ "500": { >+ "description": "Internal server error", >+ "schema": { >+ "$ref": "../definitions/error.json" >+ } >+ } >+ } >+ }, >+ "post": { >+ "x-mojo-controller": "Koha::REST::V1::Labels::Sheets", >+ "operationId": "createSheet", >+ "x-koha-permission": { >+ "labels": "sheets_new" >+ }, >+ "tags": ["labels"], >+ "produces": [ >+ "text/plain" >+ ], >+ "summary": "Create a new label positioning sheet", >+ "parameters": [ >+ { >+ "name": "sheet", >+ "in": "formData", >+ "description": "A JSON object of the sheet, containing the items, regions and elements.", >+ "required": true, >+ "type": "string" >+ } >+ ], >+ "responses": { >+ "201": { >+ "description": "The created sheet", >+ "schema": { "type": "string" } >+ }, >+ "400": { >+ "description": "Missing or wrong parameters", >+ "schema": { "$ref": "../definitions/error.json" } >+ }, >+ "500": { >+ "description": "Internal server error", >+ "schema": { >+ "$ref": "../definitions/error.json" >+ } >+ } >+ } >+ }, >+ "put": { >+ "x-mojo-controller": "Koha::REST::V1::Labels::Sheets", >+ "operationId": "updateSheet", >+ "x-koha-permission": { >+ "labels": "sheets_mod" >+ }, >+ "tags": ["labels"], >+ "produces": [ >+ "application/json" >+ ], >+ "summary": "Modify a label positioning sheet", >+ "parameters": [ >+ { >+ "name": "sheet", >+ "in": "formData", >+ "description": "A JSON object of the sheet, containing the items, regions and elements.", >+ "required": true, >+ "type": "string" >+ } >+ ], >+ "responses": { >+ "201": { >+ "description": "The modified sheet", >+ "schema": { "type" : "string" } >+ }, >+ "400": { >+ "description": "Missing or wrong parameters", >+ "schema": { "$ref": "../definitions/error.json" } >+ }, >+ "404": { >+ "description": "Sheet not found", >+ "schema": { "$ref": "../definitions/error.json" } >+ }, >+ "500": { >+ "description": "Internal server error", >+ "schema": { >+ "$ref": "../definitions/error.json" >+ } >+ } >+ } >+ } >+ }, >+ "/labels/sheets/version": { >+ "get": { >+ "x-mojo-controller": "Koha::REST::V1::Labels::Sheets", >+ "operationId": "listSheetVersions", >+ "x-koha-permission": { >+ "labels": "sheets_get" >+ }, >+ "tags": ["labels"], >+ "produces": [ >+ "application/json" >+ ], >+ "summary": "Get a list of label positioning sheet ids and versions.", >+ "responses": { >+ "200": { >+ "description": "A list of sheet ids and versions", >+ "schema": { >+ "type": "array", >+ "items": { >+ "type": "object", >+ "required": [ >+ "id", >+ "version" >+ ], >+ "properties": { >+ "id": { >+ "type": "integer" >+ }, >+ "version": { >+ "type": "number", >+ "format": "float" >+ } >+ } >+ } >+ } >+ }, >+ "404": { >+ "description": "No sheets in Koha", >+ "schema": { "$ref": "../definitions/error.json" } >+ }, >+ "500": { >+ "description": "Internal server error", >+ "schema": { >+ "$ref": "../definitions/error.json" >+ } >+ } >+ } >+ } >+ }, >+ "/labels/sheets/{sheet_identifier}/{sheet_version}": { >+ "delete": { >+ "x-mojo-controller": "Koha::REST::V1::Labels::Sheets", >+ "operationId": "deleteSheet", >+ "x-koha-permission": { >+ "labels": "sheets_del" >+ }, >+ "tags": ["labels"], >+ "parameters": [ >+ { "$ref": "../parameters.json#/sheet_identifierPathParam" }, >+ { "$ref": "../parameters.json#/sheet_versionPathParam" } >+ ], >+ "produces": [ >+ "" >+ ], >+ "summary": "Delete a label positioning sheet", >+ "description": "By default only deletes the newest version, exposing the older version.", >+ "responses": { >+ "204": { >+ "description": "Deleting the message succeeded.", >+ "schema": { >+ "type": "string" >+ } >+ }, >+ "404": { >+ "description": "Sheet not found", >+ "schema": { >+ "$ref": "../definitions/error.json" >+ } >+ }, >+ "500": { >+ "description": "Internal server error", >+ "schema": { >+ "$ref": "../definitions/error.json" >+ } >+ } >+ } >+ }, >+ "get": { >+ "x-mojo-controller": "Koha::REST::V1::Labels::Sheets", >+ "operationId": "getSheet", >+ "x-koha-permission": { >+ "labels": "sheets_get" >+ }, >+ "tags": ["labels"], >+ "parameters": [ >+ { "$ref": "../parameters.json#/sheet_identifierPathParam" }, >+ { "$ref": "../parameters.json#/sheet_versionPathParam" } >+ ], >+ "produces": [ >+ "application/json" >+ ], >+ "summary": "Get a label positioning sheet", >+ "responses": { >+ "200": { >+ "description": "The sheet", >+ "schema": { >+ "type" : "object" >+ } >+ }, >+ "404": { >+ "description": "Sheet not found", >+ "schema": { >+ "$ref": "../definitions/error.json" >+ } >+ }, >+ "500": { >+ "description": "Internal server error", >+ "schema": { >+ "$ref": "../definitions/error.json" >+ } >+ } >+ } >+ } >+ } >+} >\ No newline at end of file >diff --git a/api/v1/swagger/paths/lists.json b/api/v1/swagger/paths/lists.json >new file mode 100644 >index 0000000..ae68537 >--- /dev/null >+++ b/api/v1/swagger/paths/lists.json >@@ -0,0 +1,50 @@ >+{ >+ "/lists/{listname}/contents": { >+ "post": { >+ "x-mojo-controller": "Koha::REST::V1::Lists::Contents", >+ "x-koha-permission": { >+ "catalogue": "*" >+ }, >+ "operationId": "addToList", >+ "tags": ["lists"], >+ "parameters": [ >+ { "$ref": "../parameters.json#/listnamePathParam" }, >+ { "$ref": "../parameters.json#/listContent" } >+ ], >+ "produces": ["application/json"], >+ "responses": { >+ "200": { >+ "description": "The list article", >+ "schema": { "$ref": "../definitions/listContent.json" } >+ }, >+ "404": { >+ "description": "The given list doesn't exist", >+ "schema": { "$ref": "../definitions/error.json" } >+ } >+ } >+ }, >+ "delete": { >+ "x-mojo-controller": "Koha::REST::V1::Lists::Contents", >+ "x-koha-permission": { >+ "catalogue": "*" >+ }, >+ "operationId": "deleteContents", >+ "tags": ["lists"], >+ "parameters": [ >+ { "$ref": "../parameters.json#/listnamePathParam" }, >+ { "$ref": "../parameters.json#/listContent" } >+ ], >+ "produces": ["application/json"], >+ "responses": { >+ "200": { >+ "description": "All list articles are deleted", >+ "schema": { "$ref": "../definitions/listContent.json" } >+ }, >+ "404": { >+ "description": "The given list doesn't exist", >+ "schema": { "$ref": "../definitions/error.json" } >+ } >+ } >+ } >+ } >+} >\ No newline at end of file >diff --git a/api/v1/swagger/paths/messages.json b/api/v1/swagger/paths/messages.json >new file mode 100644 >index 0000000..d91ff8f >--- /dev/null >+++ b/api/v1/swagger/paths/messages.json >@@ -0,0 +1,244 @@ >+{ >+ "/messages": { >+ "get": { >+ "x-mojo-controller": "Koha::REST::V1::Messages", >+ "operationId": "listMessages", >+ "x-koha-permission": { >+ "messages": "get_message" >+ }, >+ "tags": ["messages"], >+ "produces": [ >+ "application/json" >+ ], >+ "responses": { >+ "200": { >+ "description": "A list of messages", >+ "schema": { >+ "type": "array", >+ "items": { >+ "$ref" : "../definitions/message.json" >+ } >+ } >+ }, >+ "404": { >+ "description": "Messages not found", >+ "schema": { >+ "$ref": "../definitions/error.json" >+ } >+ } >+ } >+ }, >+ "post": { >+ "x-mojo-controller": "Koha::REST::V1::Messages", >+ "operationId": "createMessage", >+ "x-koha-permission": { >+ "messages": "create_message" >+ }, >+ "tags": ["messages"], >+ "parameters": [ >+ { >+ "name": "body", >+ "in": "body", >+ "description": "A JSON object containing informations about the new message", >+ "required": true, >+ "schema": { "$ref": "../definitions/message.json" } >+ } >+ ], >+ "produces": [ >+ "application/json" >+ ], >+ "responses": { >+ "201": { >+ "description": "A message", >+ "schema": { >+ "$ref": "../definitions/message.json" >+ } >+ }, >+ "400": { >+ "description": "Missing or wrong parameters", >+ "schema": { "$ref": "../definitions/error.json" } >+ } >+ } >+ } >+ }, >+ "/messages/{messagenumber}": { >+ "put": { >+ "x-mojo-controller": "Koha::REST::V1::Messages", >+ "operationId": "updateMessage", >+ "x-koha-permission": { >+ "messages": "update_message" >+ }, >+ "tags": ["messages"], >+ "parameters": [ >+ { >+ "name": "body", >+ "in": "body", >+ "description": "A JSON object containing informations about the new message", >+ "required": false, >+ "schema": { "$ref": "../definitions/message.json" } >+ }, >+ { >+ "$ref": "../parameters.json#/messagenumberPathParam" >+ } >+ ], >+ "produces": [ >+ "application/json" >+ ], >+ "responses": { >+ "200": { >+ "description": "A message", >+ "schema": { >+ "$ref" : "../definitions/message.json" >+ } >+ }, >+ "400": { >+ "description": "Missing or wrong parameters", >+ "schema": { "$ref": "../definitions/error.json" } >+ }, >+ "404": { >+ "description": "Message not found", >+ "schema": { >+ "$ref": "../definitions/error.json" >+ } >+ } >+ } >+ }, >+ "delete": { >+ "x-mojo-controller": "Koha::REST::V1::Messages", >+ "operationId": "deleteMessage", >+ "x-koha-permission": { >+ "messages": "delete_message" >+ }, >+ "tags": ["messages"], >+ "parameters": [ >+ { >+ "$ref": "../parameters.json#/messagenumberPathParam" >+ } >+ ], >+ "produces": [ >+ "application/json" >+ ], >+ "responses": { >+ "204": { >+ "description": "Deleting the message succeeded.", >+ "schema": { >+ "type": "string" >+ } >+ }, >+ "404": { >+ "description": "Message not found.", >+ "schema": { >+ "$ref": "../definitions/error.json" >+ } >+ } >+ } >+ }, >+ "get": { >+ "x-mojo-controller": "Koha::REST::V1::Messages", >+ "operationId": "getMessage", >+ "x-koha-permission": { >+ "messages": "get_message" >+ }, >+ "tags": ["messages"], >+ "parameters": [ >+ { >+ "$ref": "../parameters.json#/messagenumberPathParam" >+ } >+ ], >+ "produces": [ >+ "application/json" >+ ], >+ "responses": { >+ "200": { >+ "description": "A message", >+ "schema": { >+ "$ref" : "../definitions/message.json" >+ } >+ }, >+ "404": { >+ "description": "Message not found", >+ "schema": { >+ "$ref": "../definitions/error.json" >+ } >+ } >+ } >+ } >+ }, >+ "/messages/{messagenumber}/resend": { >+ "post": { >+ "x-mojo-controller": "Koha::REST::V1::Messages", >+ "operationId": "createResend", >+ "description": "Resends a message.", >+ "x-koha-permission": { >+ "messages": "resend_message" >+ }, >+ "tags": ["messages"], >+ "parameters": [ >+ { >+ "$ref": "../parameters.json#/messagenumberPathParam" >+ } >+ ], >+ "produces": [ >+ "application/json" >+ ], >+ "responses": { >+ "204": { >+ "description": "Resending the message succeeded.", >+ "schema": { >+ "type": "string" >+ } >+ }, >+ "404": { >+ "description": "Message not found", >+ "schema": { >+ "$ref": "../definitions/error.json" >+ } >+ } >+ } >+ } >+ }, >+ "/messages/{messagenumber}/report/labyrintti": { >+ "post": { >+ "x-mojo-controller": "Koha::REST::V1::Messages::Reports", >+ "operationId": "createLabyrinttiReport", >+ "tags": ["messages"], >+ "parameters": [ >+ { >+ "$ref": "../parameters.json#/messagenumberPathParam" >+ }, >+ { >+ "name": "status", >+ "in": "formData", >+ "type": "string", >+ "description": "Status of the delivery", >+ "required": true >+ }, >+ { >+ "name": "message", >+ "in": "formData", >+ "type": "string", >+ "description": "Delivery notes", >+ "required": true >+ } >+ ], >+ "consumes": ["application/x-www-form-urlencoded"], >+ "produces": [ >+ "application/json" >+ ], >+ "responses": { >+ "200": { >+ "description": "Response for receiving the report.", >+ "schema": { >+ "type": "string" >+ } >+ }, >+ "404": { >+ "description": "Message not found", >+ "schema": { >+ "$ref": "../definitions/error.json" >+ } >+ } >+ } >+ } >+ } >+} >\ No newline at end of file >diff --git a/api/v1/swagger/paths/serials.json b/api/v1/swagger/paths/serials.json >new file mode 100644 >index 0000000..b05e8db >--- /dev/null >+++ b/api/v1/swagger/paths/serials.json >@@ -0,0 +1,74 @@ >+{ >+ "/serialitems": { >+ "get": { >+ "x-mojo-controller": "Koha::REST::V1::Serials", >+ "operationId": "getSerialItems", >+ "tags": ["serials"], >+ "summary": "Fetches SerialItems representing Serials (without an Item-object) and Magazines (with an Item-object)", >+ "description": "You cannot return all SerialItems, but you must filter your search with GET-parameters.", >+ "produces": [ >+ "application/json" >+ ], >+ "parameters": [ >+ { >+ "name": "biblionumber", >+ "in": "query", >+ "description": "Internal biblio identifier", >+ "required": true, >+ "type": "integer" >+ } >+ ], >+ "responses": { >+ "200": { >+ "description": "Fetching the objects succeeded.", >+ "schema": { >+ "type": "object" >+ } >+ } >+ } >+ } >+ }, >+ "/serials/collection": { >+ "get": { >+ "x-mojo-controller": "Koha::REST::V1::Serials", >+ "operationId": "getCollection", >+ "tags": ["serials"], >+ "summary": "Fetches a volume overview of all serials in the system, and a count of how many have been received.", >+ "description": "Fetches a volume overview of all serials in the system, and a count of how many have been received.", >+ "produces": [ >+ "application/json" >+ ], >+ "parameters": [ >+ { "$ref": "../parameters.json#/biblionumberQueryParam" }, >+ { "$ref": "../parameters.json#/holdingbranchQueryParam" }, >+ { "$ref": "../parameters.json#/serialStatusQueryParam" } >+ ], >+ "responses": { >+ "200": { >+ "description": "Fetching the objects succeeded.", >+ "schema": { >+ "type": "object" >+ } >+ }, >+ "404": { >+ "description": "No objects match the search request", >+ "schema": { >+ "$ref": "../definitions/error.json" >+ } >+ }, >+ "400": { >+ "description": "Bad search parameters.", >+ "schema": { >+ "$ref": "../definitions/error.json" >+ } >+ }, >+ "500": { >+ "description": "Server-side error. I am sorry :(", >+ "schema": { >+ "$ref": "../definitions/error.json" >+ } >+ } >+ } >+ } >+ } >+} >diff --git a/api/v1/swagger/securityDefinitions.json b/api/v1/swagger/securityDefinitions.json >new file mode 100644 >index 0000000..cb72e74 >--- /dev/null >+++ b/api/v1/swagger/securityDefinitions.json >@@ -0,0 +1,8 @@ >+{ >+ "multi_key_auth": { >+ "type": "apiKey", >+ "name": "Authorization", >+ "in": "header", >+ "description": "Example: 'Authorization: Koha 1:0f049b5ba2f04da7e719b7166dd9e1b0efacf23747798f19efe51eb6e437f84c'\n\nConstructing the Authorization header\n\n-You brand the authorization header with 'Koha'\n-Then you give the userid/cardnumber of the user authenticating.\n-Then the hashed signature.\n\nThe signature is a HMAC-SHA256-HEX hash of several elements of the request,\nseparated by spaces:\n - HTTP method (uppercase)\n - userid/cardnumber\n - X-Koha-Date-header\nSigned with the Borrowers API key\n\n\nPseudocode example:\n\nSignature = HMAC-SHA256-HEX('HTTPS' + ' ' +\n '/api/v1/borrowers/12?howdoyoudo=voodoo' + ' ' +\n 'admin69' + ' ' +\n '760818212' + ' ' +\n 'frJIUN8DYpKDtOLCwo//yllqDzg='\n );\n" >+ } >+} >\ No newline at end of file >diff --git a/api/v1/swagger/swagger.json b/api/v1/swagger/swagger.json >new file mode 100644 >index 0000000..0bd97a7 >--- /dev/null >+++ b/api/v1/swagger/swagger.json >@@ -0,0 +1,20 @@ >+{ >+ "swagger": "2.0", >+ "info": { >+ "$ref": "info.json" >+ }, >+ "x-mojo-around-action": "Koha::REST::V1::koha_authenticate", >+ "basePath": "/api/v1", >+ "paths": { >+ "$ref": "paths.json" >+ }, >+ "definitions": { >+ "$ref": "definitions.json" >+ }, >+ "parameters": { >+ "$ref": "parameters.json" >+ }, >+ "securityDefinitions": { >+ "$ref": "securityDefinitions.json" >+ } >+} >\ No newline at end of file >diff --git a/api/v1/swagger/swagger.min.json b/api/v1/swagger/swagger.min.json >new file mode 100644 >index 0000000..c032af0 >--- /dev/null >+++ b/api/v1/swagger/swagger.min.json >@@ -0,0 +1 @@ >+{"basePath":"\/api\/v1","swagger":"2.0","id":"swagger\/swagger.json","x-mojo-around-action":"Koha::REST::V1::koha_authenticate","info":{"contact":{"name":"Koha Team","url":"http:\/\/koha-community.org\/"},"title":"Koha REST API","license":{"name":"GPL v3","url":"http:\/\/www.gnu.org\/licenses\/gpl.txt"},"version":"1"},"parameters":{"holdingbranchQueryParam":{"type":"string","in":"query","name":"holdingbranch","description":"The code of the branch where the Items have been last seen.","required":false},"borrowernumberPathParam":{"description":"Internal borrower identifier","required":true,"type":"integer","in":"path","name":"borrowernumber"},"borrowernumberQueryParam":{"name":"borrowernumber","in":"query","type":"integer","required":false,"description":"The internal id of the Borrower, unique value"},"pattern_yQueryParam":{"type":"string","in":"query","name":"pattern_y","description":"the second enumeration, eg volume.","required":false},"biblionumberPathParam":{"description":"Internal biblio identifier","required":true,"type":"integer","in":"path","name":"biblionumber"},"sheet_identifierPathParam":{"required":true,"description":"Internal sheet identifier","name":"sheet_identifier","type":"integer","in":"path"},"listContent":{"in":"body","name":"listContent","schema":{"type":"object","properties":{"listContentNumber":{"type":"integer","description":"The internal identifier for this list article"},"borrowernumber":{"type":"integer","description":"Borrower internal identifier"},"itemnumber":{"type":"integer","description":"Item internal identifier"},"biblionumber":{"description":"Biblio internal identifier","type":"integer"}}},"description":"The list article","required":true},"messagenumberPathParam":{"name":"messagenumber","in":"path","type":"integer","required":true,"description":"Internal message identifier"},"useridQueryParam":{"name":"userid","type":"string","in":"query","required":false,"description":"The userid of the Borrower, unique value"},"pattern_zQueryParam":{"type":"string","in":"query","name":"pattern_z","description":"the third enumeration field.","required":false},"session":{"description":"The CGISESSID Cookie used to authenticate a session","schema":{"required":["sessionid"],"properties":{"sessionid":{"type":"string","description":"The Koha sessionid to be tested"}},"type":"object"},"required":true,"in":"body","name":"session"},"serialStatusQueryParam":{"description":"Status of a serial. 1 = Expected, 2 = Received, 3 = Late, 4 = Not issued, 7 = Claimed.","required":false,"in":"query","type":"integer","name":"serialStatus"},"sheet_versionPathParam":{"name":"sheet_version","in":"path","type":"number","format":"float","required":true,"description":"Sheet version number. If omitted, operations target the newest version. Set to '631373.00' to affect all versions."},"listnamePathParam":{"type":"string","in":"path","name":"listname","description":"list name","required":true},"pattern_xQueryParam":{"name":"pattern_x","type":"string","in":"query","required":false,"description":"The first serial issue enumeration field, typically the year."},"cardnumberQueryParam":{"description":"The cardnumber of the Borrower, unique value","required":false,"type":"string","in":"query","name":"cardnumber"},"biblionumberQueryParam":{"name":"biblionumber","in":"query","type":"integer","required":true,"description":"Internal biblio identifier"},"limitQueryParam":{"required":false,"description":"Limit the resultset to this many results.","name":"limit","type":"integer","in":"query"}},"definitions":{"listContent":{"properties":{"listContentNumber":{"type":"integer","description":"The internal identifier for this list article"},"borrowernumber":{"type":"integer","description":"Borrower internal identifier"},"itemnumber":{"type":"integer","description":"Item internal identifier"},"biblionumber":{"description":"Biblio internal identifier","type":"integer"}},"type":"object"},"borrower":{"properties":{"cardnumber":{"type":"string","description":"library assigned ID number for borrowers"},"firstname":{"type":"string","description":"borrower's first name"},"borrowernumber":{"type":"integer","description":"Borrower internal identifier"},"surname":{"type":"string","description":"borrower's last name"}},"type":"object"},"biblionumber":{"description":"Biblio internal identifier","type":"integer"},"message":{"type":"object","properties":{"letter_code":{"type":"string","description":""},"to_address":{"type":"string","description":"Destination email address"},"message_transport_type":{"type":"string","description":"Transport method. Values accepted by default are 'email', 'sms', 'phone' and 'print'"},"from_address":{"description":"Source address of email","type":"string"},"metadata":{"description":"","type":"string"},"time_queued":{"description":"Date and time of when message was placed in queue","type":"string"},"content":{"type":"string","description":"Content of the message"},"content_type":{"description":"Content type","type":"string"},"subject":{"description":"Subject of the message","type":"string"},"status":{"description":"Delivery status","type":"string"},"message_id":{"type":"integer","description":"Message internal identifier"},"borrowernumber":{"type":"integer","description":"Borrower internal identifier"},"delivery_note":{"description":"Additional delivery notes","type":"string"}}},"session":{"type":"object","properties":{"lastname":{"type":"string","description":"borrower's last name"},"email":{"description":"borrower's primary email address","type":"string"},"firstname":{"description":"borrower's first name","type":"string"}}},"cardnumber":{"type":"string","description":"Library assigned ID number for Borrowers"},"holds":{"items":{"type":"object","properties":{"notificationdate":{"description":"currently unused","type":"string"},"found":{"description":"a one letter code defining what the status of the reserve is after it has been confirmed","type":"string"},"itemnumber":{"type":"integer","description":"Item internal identifier"},"timestamp":{"description":"date and time the reserve was last updated","type":"string"},"lowestPriority":{"description":"","type":"string"},"priority":{"description":"where in the queue the patron sits","type":"string"},"reservedate":{"type":"string","description":"the date the reserve was placed"},"waitingdate":{"description":"the date the item was marked as waiting for the patron at the library","type":"string"},"borrowernumber":{"type":"integer","description":"Borrower internal identifier"},"cancellationdate":{"type":"string","description":"the date the reserve was cancelled"},"branchcode":{"type":"string","description":"Code identifying a library"},"constrainttype":{"description":"type of constraint","type":"string"},"reserve_id":{"type":"number","description":"Internal reserve identifier"},"reminderdate":{"type":"string","description":"currently unused"},"expirationdate":{"type":"string","description":"the date the reserve expires"},"suspend_until":{"description":"","type":"string"},"biblionumber":{"description":"Biblio internal identifier","type":"integer"},"reservenotes":{"description":"notes related to this reserve","type":"string"},"suspend":{"description":"","type":"string"}}},"type":"array"},"branchcode":{"type":"string","description":"Code identifying a library"},"error":{"type":"object","properties":{"error":{"type":"string","description":"Error message"}}},"testedSession":{"required":["sessionid"],"properties":{"sessionid":{"type":"string","description":"The Koha sessionid to be tested"}},"type":"object"},"listContentNumber":{"description":"The internal identifier for this list article","type":"integer"},"hold":{"properties":{"notificationdate":{"description":"currently unused","type":"string"},"found":{"description":"a one letter code defining what the status of the reserve is after it has been confirmed","type":"string"},"itemnumber":{"type":"integer","description":"Item internal identifier"},"timestamp":{"description":"date and time the reserve was last updated","type":"string"},"lowestPriority":{"description":"","type":"string"},"priority":{"description":"where in the queue the patron sits","type":"string"},"reservedate":{"type":"string","description":"the date the reserve was placed"},"waitingdate":{"description":"the date the item was marked as waiting for the patron at the library","type":"string"},"borrowernumber":{"type":"integer","description":"Borrower internal identifier"},"cancellationdate":{"type":"string","description":"the date the reserve was cancelled"},"branchcode":{"type":"string","description":"Code identifying a library"},"constrainttype":{"description":"type of constraint","type":"string"},"reserve_id":{"type":"number","description":"Internal reserve identifier"},"reminderdate":{"type":"string","description":"currently unused"},"expirationdate":{"type":"string","description":"the date the reserve expires"},"suspend_until":{"description":"","type":"string"},"biblionumber":{"description":"Biblio internal identifier","type":"integer"},"reservenotes":{"description":"notes related to this reserve","type":"string"},"suspend":{"description":"","type":"string"}},"type":"object"},"borrowerStatus":{"type":"object","properties":{"too_many_renewals":{"description":"","type":"boolean"},"too_many_items_lost":{"description":"","type":"boolean"},"fines":{"format":"double","description":"Total due fines","type":"number"},"recall_overdue":{"type":"boolean","description":""},"borrowernumber":{"description":"Borrower internal identifier","type":"integer"},"homebranch":{"description":"Home library\/branch.","type":"string"},"too_many_items_billed":{"description":"","type":"boolean"},"excessive_outstanding_fees":{"type":"boolean","description":""},"language":{"type":"string","description":"Desired language of service"},"too_many_items_charged":{"type":"boolean","description":""},"firstname":{"description":"First name","type":"string"},"hold_privileges_denied":{"type":"boolean","description":""},"card_reported_lost":{"type":"boolean","description":""},"surname":{"type":"string","description":"Last name"},"recall_privileges_denied":{"description":"","type":"boolean"},"cardnumber":{"type":"string","description":"Library assigned ID number for Borrowers"},"too_many_items_overdue":{"type":"boolean","description":""},"excessive_outstanding_fines":{"type":"boolean","description":""},"too_many_claims_of_items_returned":{"description":"","type":"boolean"},"charge_privileges_denied":{"description":"","type":"boolean"},"renewal_privileges_denied":{"description":"","type":"boolean"}}},"newBorrowerHoldBody":{"properties":{"expirationdate":{"type":"string","format":"date","description":"Reserve end date"},"itemnumber":{"description":"Item internal identifier","type":"integer"},"branchcode":{"description":"Pickup location","type":"string"},"biblionumber":{"type":"integer","description":"Biblio internal identifier"},"suspend_until":{"type":"string","description":"Suspend the Hold until this date, so the Hold won't get caught but advances in queue.","format":"date"}},"type":"object"},"borrowernumber":{"type":"integer","description":"Borrower internal identifier"},"itemnumber":{"type":"integer","description":"Item internal identifier"}},"securityDefinitions":{"multi_key_auth":{"name":"Authorization","type":"apiKey","in":"header","description":"Example: 'Authorization: Koha 1:0f049b5ba2f04da7e719b7166dd9e1b0efacf23747798f19efe51eb6e437f84c'\n\nConstructing the Authorization header\n\n-You brand the authorization header with 'Koha'\n-Then you give the userid\/cardnumber of the user authenticating.\n-Then the hashed signature.\n\nThe signature is a HMAC-SHA256-HEX hash of several elements of the request,\nseparated by spaces:\n - HTTP method (uppercase)\n - userid\/cardnumber\n - X-Koha-Date-header\nSigned with the Borrowers API key\n\n\nPseudocode example:\n\nSignature = HMAC-SHA256-HEX('HTTPS' + ' ' +\n '\/api\/v1\/borrowers\/12?howdoyoudo=voodoo' + ' ' +\n 'admin69' + ' ' +\n '760818212' + ' ' +\n 'frJIUN8DYpKDtOLCwo\/\/yllqDzg='\n );\n"}},"paths":{"\/borrowers\/{borrowernumber}\/holds":{"get":{"operationId":"listBorrowerHolds","produces":["application\/json"],"x-mojo-controller":"Koha::REST::V1::Borrowers::Holds","responses":{"404":{"description":"Borrower not found","schema":{"type":"object","properties":{"error":{"type":"string","description":"Error message"}}}},"200":{"schema":{"items":{"type":"object","properties":{"notificationdate":{"description":"currently unused","type":"string"},"found":{"description":"a one letter code defining what the status of the reserve is after it has been confirmed","type":"string"},"itemnumber":{"type":"integer","description":"Item internal identifier"},"timestamp":{"description":"date and time the reserve was last updated","type":"string"},"lowestPriority":{"description":"","type":"string"},"priority":{"description":"where in the queue the patron sits","type":"string"},"reservedate":{"type":"string","description":"the date the reserve was placed"},"waitingdate":{"description":"the date the item was marked as waiting for the patron at the library","type":"string"},"borrowernumber":{"type":"integer","description":"Borrower internal identifier"},"cancellationdate":{"type":"string","description":"the date the reserve was cancelled"},"branchcode":{"type":"string","description":"Code identifying a library"},"constrainttype":{"description":"type of constraint","type":"string"},"reserve_id":{"type":"number","description":"Internal reserve identifier"},"reminderdate":{"type":"string","description":"currently unused"},"expirationdate":{"type":"string","description":"the date the reserve expires"},"suspend_until":{"description":"","type":"string"},"biblionumber":{"description":"Biblio internal identifier","type":"integer"},"reservenotes":{"description":"notes related to this reserve","type":"string"},"suspend":{"description":"","type":"string"}}},"type":"array"},"description":"A list of holds"}},"parameters":[{"in":"path","type":"integer","name":"borrowernumber","description":"Internal borrower identifier","required":true}],"tags":["borrowers","holds"],"x-koha-permission":{"borrowers":"*"}},"post":{"responses":{"404":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Error message"}}},"description":"Borrower not found"},"201":{"schema":{"properties":{"notificationdate":{"description":"currently unused","type":"string"},"found":{"description":"a one letter code defining what the status of the reserve is after it has been confirmed","type":"string"},"itemnumber":{"type":"integer","description":"Item internal identifier"},"timestamp":{"description":"date and time the reserve was last updated","type":"string"},"lowestPriority":{"description":"","type":"string"},"priority":{"description":"where in the queue the patron sits","type":"string"},"reservedate":{"type":"string","description":"the date the reserve was placed"},"waitingdate":{"description":"the date the item was marked as waiting for the patron at the library","type":"string"},"borrowernumber":{"type":"integer","description":"Borrower internal identifier"},"cancellationdate":{"type":"string","description":"the date the reserve was cancelled"},"branchcode":{"type":"string","description":"Code identifying a library"},"constrainttype":{"description":"type of constraint","type":"string"},"reserve_id":{"type":"number","description":"Internal reserve identifier"},"reminderdate":{"type":"string","description":"currently unused"},"expirationdate":{"type":"string","description":"the date the reserve expires"},"suspend_until":{"description":"","type":"string"},"biblionumber":{"description":"Biblio internal identifier","type":"integer"},"reservenotes":{"description":"notes related to this reserve","type":"string"},"suspend":{"description":"","type":"string"}},"type":"object"},"description":"Created hold"},"500":{"description":"Internal error","schema":{"properties":{"error":{"type":"string","description":"Error message"}},"type":"object"}},"403":{"schema":{"properties":{"error":{"type":"string","description":"Error message"}},"type":"object"},"description":"Hold not allowed"},"400":{"description":"Missing or wrong parameters","schema":{"properties":{"error":{"type":"string","description":"Error message"}},"type":"object"}}},"parameters":[{"required":true,"description":"Internal borrower identifier","name":"borrowernumber","in":"path","type":"integer"},{"in":"body","name":"body","schema":{"properties":{"expirationdate":{"type":"string","format":"date","description":"Reserve end date"},"itemnumber":{"description":"Item internal identifier","type":"integer"},"branchcode":{"description":"Pickup location","type":"string"},"biblionumber":{"type":"integer","description":"Biblio internal identifier"},"suspend_until":{"type":"string","description":"Suspend the Hold until this date, so the Hold won't get caught but advances in queue.","format":"date"}},"type":"object"},"description":"A Hold-object","required":true}],"x-koha-permission":{"circulate":"*"},"operationId":"addBorrowerHold","consumes":["application\/json"],"x-mojo-controller":"Koha::REST::V1::Borrowers::Holds","produces":["application\/json"],"tags":["borrowers","holds"]}},"\/labels\/sheets\/version":{"get":{"operationId":"listSheetVersions","x-mojo-controller":"Koha::REST::V1::Labels::Sheets","responses":{"500":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Error message"}}},"description":"Internal server error"},"404":{"description":"No sheets in Koha","schema":{"type":"object","properties":{"error":{"type":"string","description":"Error message"}}}},"200":{"description":"A list of sheet ids and versions","schema":{"type":"array","items":{"required":["id","version"],"properties":{"version":{"format":"float","type":"number"},"id":{"type":"integer"}},"type":"object"}}}},"produces":["application\/json"],"tags":["labels"],"x-koha-permission":{"labels":"sheets_get"},"summary":"Get a list of label positioning sheet ids and versions."}},"\/auth\/session":{"get":{"x-koha-permission":{"auth":"get_session"},"tags":["auth"],"parameters":[{"in":"body","name":"session","description":"The CGISESSID Cookie used to authenticate a session","schema":{"required":["sessionid"],"properties":{"sessionid":{"type":"string","description":"The Koha sessionid to be tested"}},"type":"object"},"required":true}],"operationId":"getSession","x-mojo-controller":"Koha::REST::V1::Auth","produces":["application\/json"],"responses":{"200":{"description":"A borrower with SSO-relevant fields","schema":{"properties":{"lastname":{"type":"string","description":"borrower's last name"},"email":{"description":"borrower's primary email address","type":"string"},"firstname":{"description":"borrower's first name","type":"string"}},"type":"object"}},"404":{"description":"Session not found","schema":{"type":"object","properties":{"error":{"type":"string","description":"Error message"}}}}}}},"\/biblios\/{biblionumber}":{"delete":{"x-koha-permission":{"editcatalogue":"delete_catalogue"},"summary":"Deletes the given Bibliographic Record","description":"Can fail if there are dependecies to the Biblio.","parameters":[{"required":true,"description":"Internal biblio identifier","name":"biblionumber","in":"path","type":"integer"}],"security":[{"multi_key_auth":[]}],"responses":{"204":{"schema":{"type":"string"},"description":"Deleting the Record succeeded."},"400":{"description":"Cannot delete the Bibliographic Record due to constraints. A constraint can be for example the presence of dependant Items.","schema":{"properties":{"error":{"type":"string","description":"Error message"}},"type":"object"}},"404":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Error message"}}},"description":"No such Bibliographic record found"}},"tags":["biblios"],"operationId":"deleteBiblio","x-mojo-controller":"Koha::REST::V1::Biblios","produces":[""]}},"\/messages\/{messagenumber}\/resend":{"post":{"operationId":"createResend","produces":["application\/json"],"x-mojo-controller":"Koha::REST::V1::Messages","tags":["messages"],"responses":{"204":{"description":"Resending the message succeeded.","schema":{"type":"string"}},"404":{"description":"Message not found","schema":{"type":"object","properties":{"error":{"type":"string","description":"Error message"}}}}},"parameters":[{"required":true,"description":"Internal message identifier","name":"messagenumber","in":"path","type":"integer"}],"description":"Resends a message.","x-koha-permission":{"messages":"resend_message"}}},"\/messages":{"get":{"operationId":"listMessages","x-mojo-controller":"Koha::REST::V1::Messages","responses":{"200":{"schema":{"type":"array","items":{"properties":{"letter_code":{"type":"string","description":""},"to_address":{"type":"string","description":"Destination email address"},"message_transport_type":{"type":"string","description":"Transport method. Values accepted by default are 'email', 'sms', 'phone' and 'print'"},"from_address":{"description":"Source address of email","type":"string"},"metadata":{"description":"","type":"string"},"time_queued":{"description":"Date and time of when message was placed in queue","type":"string"},"content":{"type":"string","description":"Content of the message"},"content_type":{"description":"Content type","type":"string"},"subject":{"description":"Subject of the message","type":"string"},"status":{"description":"Delivery status","type":"string"},"message_id":{"type":"integer","description":"Message internal identifier"},"borrowernumber":{"type":"integer","description":"Borrower internal identifier"},"delivery_note":{"description":"Additional delivery notes","type":"string"}},"type":"object"}},"description":"A list of messages"},"404":{"schema":{"properties":{"error":{"type":"string","description":"Error message"}},"type":"object"},"description":"Messages not found"}},"produces":["application\/json"],"tags":["messages"],"x-koha-permission":{"messages":"get_message"}},"post":{"x-koha-permission":{"messages":"create_message"},"parameters":[{"in":"body","name":"body","schema":{"properties":{"letter_code":{"type":"string","description":""},"to_address":{"type":"string","description":"Destination email address"},"message_transport_type":{"type":"string","description":"Transport method. Values accepted by default are 'email', 'sms', 'phone' and 'print'"},"from_address":{"description":"Source address of email","type":"string"},"metadata":{"description":"","type":"string"},"time_queued":{"description":"Date and time of when message was placed in queue","type":"string"},"content":{"type":"string","description":"Content of the message"},"content_type":{"description":"Content type","type":"string"},"subject":{"description":"Subject of the message","type":"string"},"status":{"description":"Delivery status","type":"string"},"message_id":{"type":"integer","description":"Message internal identifier"},"borrowernumber":{"type":"integer","description":"Borrower internal identifier"},"delivery_note":{"description":"Additional delivery notes","type":"string"}},"type":"object"},"description":"A JSON object containing informations about the new message","required":true}],"tags":["messages"],"produces":["application\/json"],"x-mojo-controller":"Koha::REST::V1::Messages","responses":{"201":{"schema":{"properties":{"letter_code":{"type":"string","description":""},"to_address":{"type":"string","description":"Destination email address"},"message_transport_type":{"type":"string","description":"Transport method. Values accepted by default are 'email', 'sms', 'phone' and 'print'"},"from_address":{"description":"Source address of email","type":"string"},"metadata":{"description":"","type":"string"},"time_queued":{"description":"Date and time of when message was placed in queue","type":"string"},"content":{"type":"string","description":"Content of the message"},"content_type":{"description":"Content type","type":"string"},"subject":{"description":"Subject of the message","type":"string"},"status":{"description":"Delivery status","type":"string"},"message_id":{"type":"integer","description":"Message internal identifier"},"borrowernumber":{"type":"integer","description":"Borrower internal identifier"},"delivery_note":{"description":"Additional delivery notes","type":"string"}},"type":"object"},"description":"A message"},"400":{"description":"Missing or wrong parameters","schema":{"properties":{"error":{"type":"string","description":"Error message"}},"type":"object"}}},"operationId":"createMessage"}},"\/borrowers":{"get":{"x-koha-permission":{"borrowers":"*"},"summary":"Searches for Borrowers","description":"Search borrowers from Koha, optionally filter the search with specific parameters. All parameters given, must be present in the returned Borrower-objects. If no search parameters are given, all borrowers are returned! This is certainly not what you want.","parameters":[{"in":"query","type":"string","name":"cardnumber","description":"The cardnumber of the Borrower, unique value","required":false},{"in":"query","type":"string","name":"userid","description":"The userid of the Borrower, unique value","required":false},{"description":"The internal id of the Borrower, unique value","required":false,"in":"query","type":"integer","name":"borrowernumber"}],"security":[{"multi_key_auth":[]}],"responses":{"200":{"schema":{"items":{"properties":{"cardnumber":{"type":"string","description":"library assigned ID number for borrowers"},"firstname":{"type":"string","description":"borrower's first name"},"borrowernumber":{"type":"integer","description":"Borrower internal identifier"},"surname":{"type":"string","description":"borrower's last name"}},"type":"object"},"type":"array"},"description":"A list of borrowers"}},"tags":["borrowers"],"produces":["application\/json"],"x-mojo-controller":"Koha::REST::V1::Borrowers","operationId":"listBorrowers"}},"\/lists\/{listname}\/contents":{"delete":{"parameters":[{"required":true,"description":"list name","name":"listname","type":"string","in":"path"},{"name":"listContent","in":"body","required":true,"schema":{"type":"object","properties":{"listContentNumber":{"type":"integer","description":"The internal identifier for this list article"},"borrowernumber":{"type":"integer","description":"Borrower internal identifier"},"itemnumber":{"type":"integer","description":"Item internal identifier"},"biblionumber":{"description":"Biblio internal identifier","type":"integer"}}},"description":"The list article"}],"tags":["lists"],"operationId":"deleteContents","responses":{"404":{"schema":{"properties":{"error":{"type":"string","description":"Error message"}},"type":"object"},"description":"The given list doesn't exist"},"200":{"schema":{"properties":{"listContentNumber":{"type":"integer","description":"The internal identifier for this list article"},"borrowernumber":{"type":"integer","description":"Borrower internal identifier"},"itemnumber":{"type":"integer","description":"Item internal identifier"},"biblionumber":{"description":"Biblio internal identifier","type":"integer"}},"type":"object"},"description":"All list articles are deleted"}},"x-mojo-controller":"Koha::REST::V1::Lists::Contents","produces":["application\/json"],"x-koha-permission":{"catalogue":"*"}},"post":{"produces":["application\/json"],"x-mojo-controller":"Koha::REST::V1::Lists::Contents","responses":{"404":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Error message"}}},"description":"The given list doesn't exist"},"200":{"schema":{"type":"object","properties":{"listContentNumber":{"type":"integer","description":"The internal identifier for this list article"},"borrowernumber":{"type":"integer","description":"Borrower internal identifier"},"itemnumber":{"type":"integer","description":"Item internal identifier"},"biblionumber":{"description":"Biblio internal identifier","type":"integer"}}},"description":"The list article"}},"operationId":"addToList","tags":["lists"],"parameters":[{"name":"listname","type":"string","in":"path","required":true,"description":"list name"},{"required":true,"description":"The list article","schema":{"type":"object","properties":{"listContentNumber":{"type":"integer","description":"The internal identifier for this list article"},"borrowernumber":{"type":"integer","description":"Borrower internal identifier"},"itemnumber":{"type":"integer","description":"Item internal identifier"},"biblionumber":{"description":"Biblio internal identifier","type":"integer"}}},"name":"listContent","in":"body"}],"x-koha-permission":{"catalogue":"*"}}},"\/borrowers\/{borrowernumber}":{"get":{"x-koha-permission":{"borrowers":"*"},"parameters":[{"required":true,"description":"Internal borrower identifier","name":"borrowernumber","in":"path","type":"integer"}],"security":[{"multi_key_auth":[]}],"responses":{"404":{"schema":{"properties":{"error":{"type":"string","description":"Error message"}},"type":"object"},"description":"Borrower not found"},"200":{"schema":{"type":"object","properties":{"cardnumber":{"type":"string","description":"library assigned ID number for borrowers"},"firstname":{"type":"string","description":"borrower's first name"},"borrowernumber":{"type":"integer","description":"Borrower internal identifier"},"surname":{"type":"string","description":"borrower's last name"}}},"description":"A borrower"}},"tags":["borrowers"],"x-mojo-controller":"Koha::REST::V1::Borrowers","produces":["application\/json"],"operationId":"getBorrower"}},"\/messages\/{messagenumber}":{"delete":{"produces":["application\/json"],"x-mojo-controller":"Koha::REST::V1::Messages","responses":{"204":{"schema":{"type":"string"},"description":"Deleting the message succeeded."},"404":{"schema":{"properties":{"error":{"type":"string","description":"Error message"}},"type":"object"},"description":"Message not found."}},"operationId":"deleteMessage","parameters":[{"required":true,"description":"Internal message identifier","name":"messagenumber","type":"integer","in":"path"}],"tags":["messages"],"x-koha-permission":{"messages":"delete_message"}},"put":{"x-koha-permission":{"messages":"update_message"},"parameters":[{"name":"body","in":"body","required":false,"description":"A JSON object containing informations about the new message","schema":{"properties":{"letter_code":{"type":"string","description":""},"to_address":{"type":"string","description":"Destination email address"},"message_transport_type":{"type":"string","description":"Transport method. Values accepted by default are 'email', 'sms', 'phone' and 'print'"},"from_address":{"description":"Source address of email","type":"string"},"metadata":{"description":"","type":"string"},"time_queued":{"description":"Date and time of when message was placed in queue","type":"string"},"content":{"type":"string","description":"Content of the message"},"content_type":{"description":"Content type","type":"string"},"subject":{"description":"Subject of the message","type":"string"},"status":{"description":"Delivery status","type":"string"},"message_id":{"type":"integer","description":"Message internal identifier"},"borrowernumber":{"type":"integer","description":"Borrower internal identifier"},"delivery_note":{"description":"Additional delivery notes","type":"string"}},"type":"object"}},{"name":"messagenumber","type":"integer","in":"path","required":true,"description":"Internal message identifier"}],"tags":["messages"],"x-mojo-controller":"Koha::REST::V1::Messages","responses":{"200":{"schema":{"type":"object","properties":{"letter_code":{"type":"string","description":""},"to_address":{"type":"string","description":"Destination email address"},"message_transport_type":{"type":"string","description":"Transport method. Values accepted by default are 'email', 'sms', 'phone' and 'print'"},"from_address":{"description":"Source address of email","type":"string"},"metadata":{"description":"","type":"string"},"time_queued":{"description":"Date and time of when message was placed in queue","type":"string"},"content":{"type":"string","description":"Content of the message"},"content_type":{"description":"Content type","type":"string"},"subject":{"description":"Subject of the message","type":"string"},"status":{"description":"Delivery status","type":"string"},"message_id":{"type":"integer","description":"Message internal identifier"},"borrowernumber":{"type":"integer","description":"Borrower internal identifier"},"delivery_note":{"description":"Additional delivery notes","type":"string"}}},"description":"A message"},"400":{"description":"Missing or wrong parameters","schema":{"type":"object","properties":{"error":{"type":"string","description":"Error message"}}}},"404":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Error message"}}},"description":"Message not found"}},"produces":["application\/json"],"operationId":"updateMessage"},"get":{"x-koha-permission":{"messages":"get_message"},"parameters":[{"description":"Internal message identifier","required":true,"type":"integer","in":"path","name":"messagenumber"}],"tags":["messages"],"x-mojo-controller":"Koha::REST::V1::Messages","responses":{"404":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Error message"}}},"description":"Message not found"},"200":{"description":"A message","schema":{"type":"object","properties":{"letter_code":{"type":"string","description":""},"to_address":{"type":"string","description":"Destination email address"},"message_transport_type":{"type":"string","description":"Transport method. Values accepted by default are 'email', 'sms', 'phone' and 'print'"},"from_address":{"description":"Source address of email","type":"string"},"metadata":{"description":"","type":"string"},"time_queued":{"description":"Date and time of when message was placed in queue","type":"string"},"content":{"type":"string","description":"Content of the message"},"content_type":{"description":"Content type","type":"string"},"subject":{"description":"Subject of the message","type":"string"},"status":{"description":"Delivery status","type":"string"},"message_id":{"type":"integer","description":"Message internal identifier"},"borrowernumber":{"type":"integer","description":"Borrower internal identifier"},"delivery_note":{"description":"Additional delivery notes","type":"string"}}}}},"produces":["application\/json"],"operationId":"getMessage"}},"\/serialitems":{"get":{"tags":["serials"],"operationId":"getSerialItems","produces":["application\/json"],"x-mojo-controller":"Koha::REST::V1::Serials","summary":"Fetches SerialItems representing Serials (without an Item-object) and Magazines (with an Item-object)","description":"You cannot return all SerialItems, but you must filter your search with GET-parameters.","parameters":[{"type":"integer","in":"query","name":"biblionumber","description":"Internal biblio identifier","required":true}],"responses":{"200":{"description":"Fetching the objects succeeded.","schema":{"type":"object"}}}}},"\/serials\/collection":{"get":{"summary":"Fetches a volume overview of all serials in the system, and a count of how many have been received.","description":"Fetches a volume overview of all serials in the system, and a count of how many have been received.","parameters":[{"name":"biblionumber","type":"integer","in":"query","required":true,"description":"Internal biblio identifier"},{"description":"The code of the branch where the Items have been last seen.","required":false,"in":"query","type":"string","name":"holdingbranch"},{"description":"Status of a serial. 1 = Expected, 2 = Received, 3 = Late, 4 = Not issued, 7 = Claimed.","required":false,"in":"query","type":"integer","name":"serialStatus"}],"responses":{"400":{"description":"Bad search parameters.","schema":{"properties":{"error":{"type":"string","description":"Error message"}},"type":"object"}},"200":{"description":"Fetching the objects succeeded.","schema":{"type":"object"}},"404":{"description":"No objects match the search request","schema":{"type":"object","properties":{"error":{"type":"string","description":"Error message"}}}},"500":{"description":"Server-side error. I am sorry :(","schema":{"type":"object","properties":{"error":{"type":"string","description":"Error message"}}}}},"tags":["serials"],"produces":["application\/json"],"x-mojo-controller":"Koha::REST::V1::Serials","operationId":"getCollection"}},"\/borrowers\/status":{"get":{"summary":"Returns the Borrower's details and statuses","description":"This endpoint doesn't need other authentication than the proper username and password, and can be used anonymously.<br\/>Note: Does not authenticate the Borrower to Koha!","parameters":[{"in":"formData","type":"string","name":"uname","description":"The Username the Borrower uses to authenticate","required":true},{"description":"The Password the Borrower uses to authenticate","required":true,"in":"formData","type":"string","name":"passwd"}],"responses":{"200":{"description":"Borrower information","schema":{"type":"object","properties":{"too_many_renewals":{"description":"","type":"boolean"},"too_many_items_lost":{"description":"","type":"boolean"},"fines":{"format":"double","description":"Total due fines","type":"number"},"recall_overdue":{"type":"boolean","description":""},"borrowernumber":{"description":"Borrower internal identifier","type":"integer"},"homebranch":{"description":"Home library\/branch.","type":"string"},"too_many_items_billed":{"description":"","type":"boolean"},"excessive_outstanding_fees":{"type":"boolean","description":""},"language":{"type":"string","description":"Desired language of service"},"too_many_items_charged":{"type":"boolean","description":""},"firstname":{"description":"First name","type":"string"},"hold_privileges_denied":{"type":"boolean","description":""},"card_reported_lost":{"type":"boolean","description":""},"surname":{"type":"string","description":"Last name"},"recall_privileges_denied":{"description":"","type":"boolean"},"cardnumber":{"type":"string","description":"Library assigned ID number for Borrowers"},"too_many_items_overdue":{"type":"boolean","description":""},"excessive_outstanding_fines":{"type":"boolean","description":""},"too_many_claims_of_items_returned":{"description":"","type":"boolean"},"charge_privileges_denied":{"description":"","type":"boolean"},"renewal_privileges_denied":{"description":"","type":"boolean"}}}},"400":{"description":"Password authentication failed using username or password","schema":{"type":"object","properties":{"error":{"type":"string","description":"Error message"}}}}},"tags":["borrowers"],"operationId":"status","produces":["application\/json","application\/xml"],"x-mojo-controller":"Koha::REST::V1::Borrowers"}},"\/messages\/{messagenumber}\/report\/labyrintti":{"post":{"operationId":"createLabyrinttiReport","consumes":["application\/x-www-form-urlencoded"],"produces":["application\/json"],"x-mojo-controller":"Koha::REST::V1::Messages::Reports","responses":{"404":{"description":"Message not found","schema":{"type":"object","properties":{"error":{"type":"string","description":"Error message"}}}},"200":{"schema":{"type":"string"},"description":"Response for receiving the report."}},"tags":["messages"],"parameters":[{"required":true,"description":"Internal message identifier","name":"messagenumber","type":"integer","in":"path"},{"name":"status","in":"formData","type":"string","required":true,"description":"Status of the delivery"},{"description":"Delivery notes","required":true,"in":"formData","type":"string","name":"message"}]}},"\/labels\/sheets\/{sheet_identifier}\/{sheet_version}":{"get":{"tags":["labels"],"produces":["application\/json"],"x-mojo-controller":"Koha::REST::V1::Labels::Sheets","operationId":"getSheet","summary":"Get a label positioning sheet","x-koha-permission":{"labels":"sheets_get"},"parameters":[{"required":true,"description":"Internal sheet identifier","name":"sheet_identifier","in":"path","type":"integer"},{"name":"sheet_version","in":"path","type":"number","format":"float","required":true,"description":"Sheet version number. If omitted, operations target the newest version. Set to '631373.00' to affect all versions."}],"responses":{"200":{"description":"The sheet","schema":{"type":"object"}},"404":{"schema":{"properties":{"error":{"type":"string","description":"Error message"}},"type":"object"},"description":"Sheet not found"},"500":{"description":"Internal server error","schema":{"properties":{"error":{"type":"string","description":"Error message"}},"type":"object"}}}},"delete":{"tags":["labels"],"operationId":"deleteSheet","produces":[""],"x-mojo-controller":"Koha::REST::V1::Labels::Sheets","parameters":[{"name":"sheet_identifier","in":"path","type":"integer","required":true,"description":"Internal sheet identifier"},{"description":"Sheet version number. If omitted, operations target the newest version. Set to '631373.00' to affect all versions.","format":"float","required":true,"in":"path","type":"number","name":"sheet_version"}],"responses":{"204":{"schema":{"type":"string"},"description":"Deleting the message succeeded."},"404":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Error message"}}},"description":"Sheet not found"},"500":{"description":"Internal server error","schema":{"properties":{"error":{"type":"string","description":"Error message"}},"type":"object"}}},"x-koha-permission":{"labels":"sheets_del"},"summary":"Delete a label positioning sheet","description":"By default only deletes the newest version, exposing the older version."}},"\/labels\/sheets":{"put":{"x-koha-permission":{"labels":"sheets_mod"},"summary":"Modify a label positioning sheet","responses":{"400":{"schema":{"properties":{"error":{"type":"string","description":"Error message"}},"type":"object"},"description":"Missing or wrong parameters"},"201":{"schema":{"type":"string"},"description":"The modified sheet"},"500":{"schema":{"properties":{"error":{"type":"string","description":"Error message"}},"type":"object"},"description":"Internal server error"},"404":{"description":"Sheet not found","schema":{"type":"object","properties":{"error":{"type":"string","description":"Error message"}}}}},"parameters":[{"required":true,"description":"A JSON object of the sheet, containing the items, regions and elements.","name":"sheet","in":"formData","type":"string"}],"operationId":"updateSheet","x-mojo-controller":"Koha::REST::V1::Labels::Sheets","produces":["application\/json"],"tags":["labels"]},"post":{"parameters":[{"in":"formData","type":"string","name":"sheet","description":"A JSON object of the sheet, containing the items, regions and elements.","required":true}],"responses":{"400":{"description":"Missing or wrong parameters","schema":{"properties":{"error":{"type":"string","description":"Error message"}},"type":"object"}},"201":{"schema":{"type":"string"},"description":"The created sheet"},"500":{"description":"Internal server error","schema":{"type":"object","properties":{"error":{"type":"string","description":"Error message"}}}}},"summary":"Create a new label positioning sheet","x-koha-permission":{"labels":"sheets_new"},"tags":["labels"],"operationId":"createSheet","x-mojo-controller":"Koha::REST::V1::Labels::Sheets","produces":["text\/plain"]},"get":{"operationId":"listSheets","x-mojo-controller":"Koha::REST::V1::Labels::Sheets","produces":["application\/json"],"tags":["labels"],"description":"Not designed for external use. Use this to see the structure of the sheet-objects.","x-koha-permission":{"labels":"sheets_get"},"summary":"Get a list of label positioning sheets.","responses":{"404":{"schema":{"properties":{"error":{"type":"string","description":"Error message"}},"type":"object"},"description":"No sheets in Koha"},"500":{"schema":{"properties":{"error":{"type":"string","description":"Error message"}},"type":"object"},"description":"Internal server error"},"200":{"schema":{"type":"array","items":{"type":"string"}},"description":"A list of sheets"}}}}}} >\ No newline at end of file >diff --git a/etc/koha-httpd.conf b/etc/koha-httpd.conf >index dd4c4f5..256f5f2 100644 >--- a/etc/koha-httpd.conf >+++ b/etc/koha-httpd.conf >@@ -28,13 +28,12 @@ > # SetEnv OVERRIDE_SYSPREF_PrefName Value > > ##REVERSE PROXY REQUESTS TO THE KOHA API DAEMON >- Alias /api/v1/doc __INTRANET_CGI_DIR__/api/v1/doc >- Alias /api/v1/swagger.json "__INTRANET_CGI_DIR__/api/v1/swagger.json" >+ Alias /api/v1 __INTRANET_CGI_DIR__/api/v1 > > ProxyRequests Off #Disable anonymous forward proxying > ProxyPreserveHost On > ProxyPass /api/v1/doc ! >- ProxyPass /api/v1/swagger.json ! >+ ProxyPass /api/v1/swagger ! > ProxyPass /api/v1/ http://localhost:8081/api/v1/ keepalive=On > ProxyPassReverse /api/v1/ http://localhost:8081/api/v1/ > ##REVERSE PROXYING OK >@@ -166,13 +165,12 @@ > ErrorDocument 500 /cgi-bin/koha/errors/500.pl > > ##REVERSE PROXY REQUESTS TO THE KOHA API DAEMON >- Alias /api/v1/doc __INTRANET_CGI_DIR__/api/v1/doc >- Alias /api/v1/swagger.json "__INTRANET_CGI_DIR__/api/v1/swagger.json" >+ Alias /api/v1 __INTRANET_CGI_DIR__/api/v1 > > ProxyRequests Off #Disable anonymous forward proxying > ProxyPreserveHost On > ProxyPass /api/v1/doc ! >- ProxyPass /api/v1/swagger.json ! >+ ProxyPass /api/v1/swagger ! > ProxyPass /api/v1/ http://localhost:8081/api/v1/ keepalive=On > ProxyPassReverse /api/v1/ http://localhost:8081/api/v1/ > ##REVERSE PROXYING OK >-- >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 15126
:
44372
|
44373
|
44374
|
44386
|
47785
|
47828
|
47829
|
47843
|
47844
|
48226
|
49781
|
49782
|
49783
|
49845
|
49846
|
49847
|
50142
|
50916
|
50917
|
50918
|
50919