Bug 29593: Fix wrong tag in GET /public/libraries spec
[koha.git] / api / v1 / swagger / paths / patrons_extended_attributes.json
1 {
2   "/patrons/{patron_id}/extended_attributes": {
3     "get": {
4       "x-mojo-to": "Patrons::Attributes#list_patron_attributes",
5       "operationId": "getPatronAttributes",
6       "tags": [
7         "patrons"
8       ],
9       "summary": "List extended attributes for a patron",
10       "parameters": [
11         {
12           "$ref": "../parameters.json#/patron_id_pp"
13         },
14         {
15           "$ref": "../parameters.json#/match"
16         },
17         {
18           "$ref": "../parameters.json#/order_by"
19         },
20         {
21           "$ref": "../parameters.json#/page"
22         },
23         {
24           "$ref": "../parameters.json#/per_page"
25         },
26         {
27           "$ref": "../parameters.json#/q_param"
28         },
29         {
30           "$ref": "../parameters.json#/q_body"
31         },
32         {
33           "$ref": "../parameters.json#/q_header"
34         }
35       ],
36       "produces": [
37         "application/json"
38       ],
39       "responses": {
40         "200": {
41           "description": "The patron extended attributes",
42           "schema": {
43             "type": "array",
44             "items": {
45               "$ref": "../definitions.json#/patron_extended_attribute"
46             }
47           }
48         },
49         "401": {
50           "description": "Authentication required",
51           "schema": {
52             "$ref": "../definitions.json#/error"
53           }
54         },
55         "403": {
56           "description": "Access forbidden",
57           "schema": {
58             "$ref": "../definitions.json#/error"
59           }
60         },
61         "404": {
62           "description": "Patron not found",
63           "schema": {
64             "$ref": "../definitions.json#/error"
65           }
66         },
67         "500": {
68           "description": "Internal server error",
69           "schema": {
70             "$ref": "../definitions.json#/error"
71           }
72         },
73         "503": {
74           "description": "Under maintenance",
75           "schema": {
76             "$ref": "../definitions.json#/error"
77           }
78         }
79       },
80       "x-koha-authorization": {
81         "permissions": {
82           "borrowers": "edit_borrowers"
83         }
84       }
85     },
86     "post": {
87       "x-mojo-to": "Patrons::Attributes#add",
88       "operationId": "addPatronAttribute",
89       "tags": [
90         "patrons"
91       ],
92       "summary": "Add extended attribute for a patron",
93       "parameters": [
94         {
95           "$ref": "../parameters.json#/patron_id_pp"
96         },
97         {
98           "name": "body",
99           "in": "body",
100           "description": "A JSON representation of the patron extended attribute",
101           "required": true,
102           "schema": {
103             "$ref": "../definitions.json#/patron_extended_attribute"
104           }
105         }
106       ],
107       "produces": [
108         "application/json"
109       ],
110       "responses": {
111         "201": {
112           "description": "A successfully created patron extended attribute",
113           "schema": {
114             "$ref": "../definitions.json#/patron_extended_attribute"
115           }
116         },
117         "400": {
118           "description": "Bad parameter",
119           "schema": {
120             "$ref": "../definitions.json#/error"
121           }
122         },
123         "401": {
124           "description": "Authentication required",
125           "schema": {
126             "$ref": "../definitions.json#/error"
127           }
128         },
129         "403": {
130           "description": "Access forbidden",
131           "schema": {
132             "$ref": "../definitions.json#/error"
133           }
134         },
135         "404": {
136           "description": "Patron not found",
137           "schema": {
138             "$ref": "../definitions.json#/error"
139           }
140         },
141         "409": {
142           "description": "Conflict in creating resource",
143           "schema": {
144             "$ref": "../definitions.json#/error"
145           }
146         },
147         "500": {
148           "description": "Internal server error",
149           "schema": {
150             "$ref": "../definitions.json#/error"
151           }
152         },
153         "503": {
154           "description": "Under maintenance",
155           "schema": {
156             "$ref": "../definitions.json#/error"
157           }
158         }
159       },
160       "x-koha-authorization": {
161         "permissions": {
162           "borrowers": "edit_borrowers"
163         }
164       }
165     },
166     "put": {
167       "x-mojo-to": "Patrons::Attributes#overwrite",
168       "operationId": "overwritePatronAttributes",
169       "tags": [
170         "patrons"
171       ],
172       "summary": "Overwrite extended attributes for a patron",
173       "parameters": [
174         {
175           "$ref": "../parameters.json#/patron_id_pp"
176         },
177         {
178           "name": "body",
179           "in": "body",
180           "description": "A JSON representation of the patron extended attribute",
181           "required": true,
182           "schema": {
183             "type": "array",
184             "items": {
185               "$ref": "../definitions.json#/patron_extended_attribute"
186             }
187           }
188         }
189       ],
190       "produces": [
191         "application/json"
192       ],
193       "responses": {
194         "200": {
195           "description": "The successfully created patron extended attributes",
196           "schema": {
197             "type": "array",
198             "items": {
199               "$ref": "../definitions.json#/patron_extended_attribute"
200             }
201           }
202         },
203         "400": {
204           "description": "Bad parameters",
205           "schema": {
206             "$ref": "../definitions.json#/error"
207           }
208         },
209         "401": {
210           "description": "Authentication required",
211           "schema": {
212             "$ref": "../definitions.json#/error"
213           }
214         },
215         "403": {
216           "description": "Access forbidden",
217           "schema": {
218             "$ref": "../definitions.json#/error"
219           }
220         },
221         "404": {
222           "description": "Patron not found",
223           "schema": {
224             "$ref": "../definitions.json#/error"
225           }
226         },
227         "409": {
228           "description": "Conflict in creating resource",
229           "schema": {
230             "$ref": "../definitions.json#/error"
231           }
232         },
233         "500": {
234           "description": "Internal server error",
235           "schema": {
236             "$ref": "../definitions.json#/error"
237           }
238         },
239         "503": {
240           "description": "Under maintenance",
241           "schema": {
242             "$ref": "../definitions.json#/error"
243           }
244         }
245       },
246       "x-koha-authorization": {
247         "permissions": {
248           "borrowers": "edit_borrowers"
249         }
250       }
251     }
252   },
253   "/patrons/{patron_id}/extended_attributes/{extended_attribute_id}": {
254     "patch": {
255       "x-mojo-to": "Patrons::Attributes#update",
256       "operationId": "updatePatronAttribute",
257       "tags": [
258         "patrons"
259       ],
260       "summary": "Update extended attribute",
261       "parameters": [
262         {
263           "$ref": "../parameters.json#/patron_id_pp"
264         },
265         {
266           "name": "extended_attribute_id",
267           "in": "path",
268           "description": "Internal patron extended attribute identifier",
269           "type": "integer",
270           "required": true
271         },
272         {
273           "name": "body",
274           "in": "body",
275           "description": "An object containing the updated values for the patron extended attribute",
276           "required": true,
277           "schema": {
278             "type": "object",
279             "properties": {
280               "value": {
281                 "description": "Extended attribute value",
282                 "type": "string"
283               }
284             },
285             "additionalProperties": false
286           }
287         }
288       ],
289       "produces": [
290         "application/json"
291       ],
292       "responses": {
293         "200": {
294           "description": "A successfully updated patron extended attribute",
295           "schema": {
296             "$ref": "../definitions.json#/patron_extended_attribute"
297           }
298         },
299         "400": {
300           "description": "Bad parameter",
301           "schema": {
302             "$ref": "../definitions.json#/error"
303           }
304         },
305         "401": {
306           "description": "Authentication required",
307           "schema": {
308             "$ref": "../definitions.json#/error"
309           }
310         },
311         "403": {
312           "description": "Access forbidden",
313           "schema": {
314             "$ref": "../definitions.json#/error"
315           }
316         },
317         "404": {
318           "description": "Object not found",
319           "schema": {
320             "$ref": "../definitions.json#/error"
321           }
322         },
323         "409": {
324           "description": "Conflict in updating resource",
325           "schema": {
326             "$ref": "../definitions.json#/error"
327           }
328         },
329         "500": {
330           "description": "Internal server error",
331           "schema": {
332             "$ref": "../definitions.json#/error"
333           }
334         },
335         "503": {
336           "description": "Under maintenance",
337           "schema": {
338             "$ref": "../definitions.json#/error"
339           }
340         }
341       },
342       "x-koha-authorization": {
343         "permissions": {
344           "borrowers": "edit_borrowers"
345         }
346       }
347     },
348     "delete": {
349       "x-mojo-to": "Patrons::Attributes#delete",
350       "operationId": "deletePatronAttribute",
351       "tags": [
352         "patrons"
353       ],
354       "summary": "Delete extended attribute",
355       "parameters": [
356         {
357           "$ref": "../parameters.json#/patron_id_pp"
358         },
359         {
360           "name": "extended_attribute_id",
361           "in": "path",
362           "description": "Internal patron extended attribute identifier",
363           "type": "integer",
364           "required": true
365         }
366       ],
367       "produces": [
368         "application/json"
369       ],
370       "responses": {
371         "204": {
372           "description": "Extended patron attribute deleted"
373         },
374         "401": {
375           "description": "Authentication required",
376           "schema": {
377             "$ref": "../definitions.json#/error"
378           }
379         },
380         "403": {
381           "description": "Access forbidden",
382           "schema": {
383             "$ref": "../definitions.json#/error"
384           }
385         },
386         "404": {
387           "description": "Patron not found",
388           "schema": {
389             "$ref": "../definitions.json#/error"
390           }
391         },
392         "500": {
393           "description": "Internal server error",
394           "schema": {
395             "$ref": "../definitions.json#/error"
396           }
397         },
398         "503": {
399           "description": "Under maintenance",
400           "schema": {
401             "$ref": "../definitions.json#/error"
402           }
403         }
404       },
405       "x-koha-authorization": {
406         "permissions": {
407           "borrowers": "edit_borrowers"
408         }
409       }
410     }
411   }
412 }