Bugzilla – Attachment 120846 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.81 KB, created by
Lari Taskula
on 2021-05-11 14:33:42 UTC
(
hide
)
Description:
Bug 20028: Add OpenAPI spec
Filename:
MIME Type:
Creator:
Lari Taskula
Created:
2021-05-11 14:33:42 UTC
Size:
6.81 KB
patch
obsolete
>From 44ca98a507a97fffdcb1f58928dca1211500229d 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 >--- > 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 02dbc95c01..4dfab6c153 100644 >--- a/api/v1/swagger/definitions.json >+++ b/api/v1/swagger/definitions.json >@@ -74,6 +74,9 @@ > "patron_extended_attribute": { > "$ref": "definitions/patron_extended_attribute.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 ba0c1e8b0f..f4dc6fc8fd 100644 >--- a/api/v1/swagger/paths.json >+++ b/api/v1/swagger/paths.json >@@ -130,6 +130,9 @@ > }, > "/patrons/{patron_id}/extended_attributes/{extended_attribute_id}": { > "$ref": "paths/patrons_extended_attributes.json#/~1patrons~1{patron_id}~1extended_attributes~1{extended_attribute_id}" >+ }, >+ "/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" >@@ -158,6 +161,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.25.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 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