Bug 28463: Add tags definitions in swagger.yaml
[koha.git] / api / v1 / swagger / paths / public_patrons.json
1 {
2     "/public/patrons/{patron_id}/password": {
3         "post": {
4             "x-mojo-to": "Patrons::Password#set_public",
5             "operationId": "setPatronPasswordPublic",
6             "tags": [
7                 "patrons"
8             ],
9             "parameters": [
10                 {
11                     "$ref": "../parameters.json#/patron_id_pp"
12                 },
13                 {
14                     "name": "body",
15                     "in": "body",
16                     "description": "A JSON object containing password information",
17                     "schema": {
18                         "type": "object",
19                         "properties": {
20                             "password": {
21                                 "description": "New password (plain text)",
22                                 "type": "string"
23                             },
24                             "password_repeated": {
25                                 "description": "Repeated new password (plain text)",
26                                 "type": "string"
27                             },
28                             "old_password": {
29                                 "description": "Patron's original password",
30                                 "type": "string"
31                             }
32                         },
33                         "required": [
34                             "password",
35                             "password_repeated",
36                             "old_password"
37                         ],
38                         "additionalProperties": false
39                     }
40                 }
41             ],
42             "produces": [
43                 "application/json"
44             ],
45             "responses": {
46                 "200": {
47                     "description": "Password changed"
48                 },
49                 "400": {
50                     "description": "Bad request",
51                     "schema": {
52                         "$ref": "../definitions.json#/error"
53                     }
54                 },
55                 "401": {
56                     "description": "Authentication required",
57                     "schema": {
58                         "$ref": "../definitions.json#/error"
59                     }
60                 },
61                 "403": {
62                     "description": "Access forbidden",
63                     "schema": {
64                         "$ref": "../definitions.json#/error"
65                     }
66                 },
67                 "404": {
68                     "description": "Patron not found",
69                     "schema": {
70                         "$ref": "../definitions.json#/error"
71                     }
72                 },
73                 "500": {
74                     "description": "Internal server error",
75                     "schema": {
76                         "$ref": "../definitions.json#/error"
77                     }
78                 },
79                 "503": {
80                     "description": "Under maintenance",
81                     "schema": {
82                         "$ref": "../definitions.json#/error"
83                     }
84                 }
85             },
86             "x-koha-authorization": {
87                 "allow-owner": true
88             }
89         }
90     },
91     "/public/patrons/{patron_id}/guarantors/can_see_charges": {
92         "put": {
93             "x-mojo-to": "Patrons#guarantors_can_see_charges",
94             "operationId": "setPatronGuarantorsCanSeeCharges",
95             "tags": [
96                 "patrons"
97             ],
98             "parameters": [
99                 {
100                     "$ref": "../parameters.json#/patron_id_pp"
101                 },
102                 {
103                     "name": "body",
104                     "in": "body",
105                     "description": "A boolean representing if guarantors should be able to see the patron's charges",
106                     "required": true,
107                     "schema": {
108                         "type": "object",
109                         "properties": {
110                             "allowed": {
111                                 "type": "boolean"
112                             }
113                         },
114                         "additionalProperties": false
115                     }
116                 }
117             ],
118             "produces": [
119                 "application/json"
120             ],
121             "responses": {
122                 "200": {
123                     "description": "Charges view policy for guarantors changed"
124                 },
125                 "400": {
126                     "description": "Bad request",
127                     "schema": {
128                         "$ref": "../definitions.json#/error"
129                     }
130                 },
131                 "401": {
132                     "description": "Authentication required",
133                     "schema": {
134                         "$ref": "../definitions.json#/error"
135                     }
136                 },
137                 "403": {
138                     "description": "Access forbidden",
139                     "schema": {
140                         "$ref": "../definitions.json#/error"
141                     }
142                 },
143                 "404": {
144                     "description": "Patron not found",
145                     "schema": {
146                         "$ref": "../definitions.json#/error"
147                     }
148                 },
149                 "500": {
150                     "description": "Internal server error",
151                     "schema": {
152                         "$ref": "../definitions.json#/error"
153                     }
154                 },
155                 "503": {
156                     "description": "Under maintenance",
157                     "schema": {
158                         "$ref": "../definitions.json#/error"
159                     }
160                 }
161             },
162             "x-koha-authorization": {
163                 "allow-owner": true
164             }
165         }
166     },
167     "/public/patrons/{patron_id}/guarantors/can_see_checkouts": {
168         "put": {
169             "x-mojo-to": "Patrons#guarantors_can_see_checkouts",
170             "operationId": "setPatronGuarantorsCanSeeCheckouts",
171             "tags": [
172                 "patrons"
173             ],
174             "parameters": [
175                 {
176                     "$ref": "../parameters.json#/patron_id_pp"
177                 },
178                 {
179                     "name": "body",
180                     "in": "body",
181                     "description": "A boolean representing if guarantors should be able to see the patron's checkouts",
182                     "required": true,
183                     "schema": {
184                         "type": "object",
185                         "properties": {
186                             "allowed": {
187                                 "type": "boolean"
188                             }
189                         },
190                         "additionalProperties": false
191                     }
192                 }
193             ],
194             "produces": [
195                 "application/json"
196             ],
197             "responses": {
198                 "200": {
199                     "description": "Check-out view policy for guarantors changed"
200                 },
201                 "400": {
202                     "description": "Bad request",
203                     "schema": {
204                         "$ref": "../definitions.json#/error"
205                     }
206                 },
207                 "401": {
208                     "description": "Authentication required",
209                     "schema": {
210                         "$ref": "../definitions.json#/error"
211                     }
212                 },
213                 "403": {
214                     "description": "Access forbidden",
215                     "schema": {
216                         "$ref": "../definitions.json#/error"
217                     }
218                 },
219                 "404": {
220                     "description": "Patron not found",
221                     "schema": {
222                         "$ref": "../definitions.json#/error"
223                     }
224                 },
225                 "500": {
226                     "description": "Internal server error",
227                     "schema": {
228                         "$ref": "../definitions.json#/error"
229                     }
230                 },
231                 "503": {
232                     "description": "Under maintenance",
233                     "schema": {
234                         "$ref": "../definitions.json#/error"
235                     }
236                 }
237             },
238             "x-koha-authorization": {
239                 "allow-owner": true
240             }
241         }
242     }
243 }