Bugzilla – Attachment 119976 Details for
Bug 20028
Export all patron related personal data in one package
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20028: Add OpenAPI spec
Bug-20028-Add-OpenAPI-spec.patch (text/plain), 6.79 KB, created by
Michal Denar
on 2021-04-21 19:54:46 UTC
(
hide
)
Description:
Bug 20028: Add OpenAPI spec
Filename:
MIME Type:
Creator:
Michal Denar
Created:
2021-04-21 19:54:46 UTC
Size:
6.79 KB
patch
obsolete
>From d780305135b3b55e5000d9ba0155f72add60ceb1 Mon Sep 17 00:00:00 2001 >From: Lari Taskula <lari.taskula@hypernova.fi> >Date: Fri, 19 Feb 2021 01:17:38 +0000 >Subject: [PATCH] Bug 20028: Add OpenAPI spec > >Includes a test that validates the existence of all related properties. > >To test: >1. prove t/db_dependent/api/v1/patrons_export.t > >Sponsored-by: The National Library of Finland > >Signed-off-by: Michal Denar <black23@gmail.com> >--- > api/v1/swagger/definitions.json | 3 ++ > api/v1/swagger/definitions/patron_export.json | 15 ++++++ > api/v1/swagger/paths.json | 6 +++ > api/v1/swagger/paths/patrons_export.json | 68 ++++++++++++++++++++++++++ > api/v1/swagger/paths/public_patrons.json | 69 ++++++++++++++++++++++++++- > 5 files changed, 160 insertions(+), 1 deletion(-) > create mode 100644 api/v1/swagger/definitions/patron_export.json > create mode 100644 api/v1/swagger/paths/patrons_export.json > >diff --git a/api/v1/swagger/definitions.json b/api/v1/swagger/definitions.json >index c12936736f..c3dbba98a7 100644 >--- a/api/v1/swagger/definitions.json >+++ b/api/v1/swagger/definitions.json >@@ -71,6 +71,9 @@ > "patron_balance": { > "$ref": "definitions/patron_balance.json" > }, >+ "patron_export": { >+ "$ref": "definitions/patron_export.json" >+ }, > "quote": { > "$ref": "definitions/quote.json" > }, >diff --git a/api/v1/swagger/definitions/patron_export.json b/api/v1/swagger/definitions/patron_export.json >new file mode 100644 >index 0000000000..89d6bc265b >--- /dev/null >+++ b/api/v1/swagger/definitions/patron_export.json >@@ -0,0 +1,15 @@ >+{ >+ "type": "array", >+ "items": { >+ "type": "object", >+ "properties": { >+ "data": { >+ "type": "object" >+ }, >+ "type": { >+ "type": "string" >+ } >+ } >+ }, >+ "additionalProperties": false >+} >diff --git a/api/v1/swagger/paths.json b/api/v1/swagger/paths.json >index dd9562c2f1..e76eca01d0 100644 >--- a/api/v1/swagger/paths.json >+++ b/api/v1/swagger/paths.json >@@ -122,6 +122,9 @@ > "/patrons/{patron_id}/account/credits": { > "$ref": "paths/patrons_account.json#/~1patrons~1{patron_id}~1account~1credits" > }, >+ "/patrons/{patron_id}/export": { >+ "$ref": "paths/patrons_export.json#/~1patrons~1{patron_id}~1export" >+ }, > "/patrons/{patron_id}/holds": { > "$ref": "paths/patrons_holds.json#/~1patrons~1{patron_id}~1holds" > }, >@@ -149,6 +152,9 @@ > "/public/biblios/{biblio_id}": { > "$ref": "paths/biblios.json#/~1public~1biblios~1{biblio_id}" > }, >+ "/public/patrons/{patron_id}/export": { >+ "$ref": "paths/public_patrons.json#/~1public~1patrons~1{patron_id}~1export" >+ }, > "/public/patrons/{patron_id}/password": { > "$ref": "paths/public_patrons.json#/~1public~1patrons~1{patron_id}~1password" > }, >diff --git a/api/v1/swagger/paths/patrons_export.json b/api/v1/swagger/paths/patrons_export.json >new file mode 100644 >index 0000000000..5741955cff >--- /dev/null >+++ b/api/v1/swagger/paths/patrons_export.json >@@ -0,0 +1,68 @@ >+{ >+ "/patrons/{patron_id}/export": { >+ "get": { >+ "x-mojo-to": "Patrons::Export#get", >+ "operationId": "getPatronExport", >+ "tags": [ >+ "patron" >+ ], >+ "parameters": [ >+ { >+ "$ref": "../parameters.json#/patron_id_pp" >+ }, >+ { >+ "$ref": "../parameters.json#/page" >+ }, >+ { >+ "$ref": "../parameters.json#/per_page" >+ } >+ ], >+ "produces": [ >+ "application/json" >+ ], >+ "responses": { >+ "200": { >+ "description": "Patron's data export", >+ "schema": { >+ "$ref": "../definitions.json#/patron_export" >+ } >+ }, >+ "401": { >+ "description": "Authentication required", >+ "schema": { >+ "$ref": "../definitions.json#/error" >+ } >+ }, >+ "403": { >+ "description": "Access forbidden", >+ "schema": { >+ "$ref": "../definitions.json#/error" >+ } >+ }, >+ "404": { >+ "description": "Patron not found", >+ "schema": { >+ "$ref": "../definitions.json#/error" >+ } >+ }, >+ "500": { >+ "description": "Internal server error", >+ "schema": { >+ "$ref": "../definitions.json#/error" >+ } >+ }, >+ "503": { >+ "description": "Under maintenance", >+ "schema": { >+ "$ref": "../definitions.json#/error" >+ } >+ } >+ }, >+ "x-koha-authorization": { >+ "permissions": { >+ "borrowers": "edit_borrowers" >+ } >+ } >+ } >+ } >+} >diff --git a/api/v1/swagger/paths/public_patrons.json b/api/v1/swagger/paths/public_patrons.json >index 5db073c4eb..f98bdb6b0f 100644 >--- a/api/v1/swagger/paths/public_patrons.json >+++ b/api/v1/swagger/paths/public_patrons.json >@@ -1,4 +1,71 @@ > { >+ "/public/patrons/{patron_id}/export": { >+ "get": { >+ "x-mojo-to": "Patrons::Export#get_public", >+ "operationId": "getPublicPatronExport", >+ "tags": [ >+ "patron" >+ ], >+ "parameters": [ >+ { >+ "$ref": "../parameters.json#/patron_id_pp" >+ }, >+ { >+ "$ref": "../parameters.json#/page" >+ }, >+ { >+ "$ref": "../parameters.json#/per_page" >+ } >+ ], >+ "produces": [ >+ "application/json" >+ ], >+ "responses": { >+ "200": { >+ "description": "Patron's data export", >+ "schema": { >+ "$ref": "../definitions.json#/patron_export" >+ } >+ }, >+ "401": { >+ "description": "Authentication required", >+ "schema": { >+ "$ref": "../definitions.json#/error" >+ } >+ }, >+ "403": { >+ "description": "Access forbidden", >+ "schema": { >+ "$ref": "../definitions.json#/error" >+ } >+ }, >+ "404": { >+ "description": "Patron not found", >+ "schema": { >+ "$ref": "../definitions.json#/error" >+ } >+ }, >+ "500": { >+ "description": "Internal server error", >+ "schema": { >+ "$ref": "../definitions.json#/error" >+ } >+ }, >+ "503": { >+ "description": "Under maintenance", >+ "schema": { >+ "$ref": "../definitions.json#/error" >+ } >+ } >+ }, >+ "x-koha-authorization": { >+ "permissions": { >+ "borrowers": "edit_borrowers" >+ }, >+ "allow-owner": true >+ } >+ } >+ }, > "/public/patrons/{patron_id}/password": { > "post": { > "x-mojo-to": "Patrons::Password#set_public", >@@ -237,4 +304,4 @@ > } > } > } >-} >\ No newline at end of file >+} >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 20028
:
75622
|
78095
|
79376
|
79381
|
116344
|
116604
|
117106
|
117107
|
117108
|
117109
|
119968
|
119969
|
119970
|
119971
|
119972
|
119974
|
119975
|
119976
|
119977
|
120844
|
120845
|
120846
|
120847
|
124156
|
124157
|
124158
|
124159
|
124160
|
124161
|
124164
|
124165
|
124166
|
124167
|
124168