]> git.koha-community.org Git - koha.git/blob - api/v1/swagger/paths/libraries.json
Bug 28463: Add summary to all routes
[koha.git] / api / v1 / swagger / paths / libraries.json
1 {
2   "/libraries": {
3     "get": {
4       "x-mojo-to": "Libraries#list",
5       "operationId": "listLibraries",
6       "tags": [
7         "library"
8       ],
9       "summary": "List libraries",
10       "parameters": [
11         {
12           "name": "name",
13           "in": "query",
14           "description": "Case insensitive 'starts-with' search on name",
15           "required": false,
16           "type": "string"
17         },
18         {
19           "name": "address1",
20           "in": "query",
21           "description": "Case insensitive 'starts-with' search on address1",
22           "required": false,
23           "type": "string"
24         },
25         {
26           "name": "address2",
27           "in": "query",
28           "description": "Case insensitive 'starts-with' search on address2",
29           "required": false,
30           "type": "string"
31         },
32         {
33           "name": "address3",
34           "in": "query",
35           "description": "Case insensitive 'starts-with' search on address3",
36           "required": false,
37           "type": "string"
38         },
39         {
40           "name": "postal_code",
41           "in": "query",
42           "description": "Case insensitive 'starts-with' search on postal code",
43           "required": false,
44           "type": "string"
45         },
46         {
47           "name": "city",
48           "in": "query",
49           "description": "Case insensitive 'starts-with' search on city",
50           "required": false,
51           "type": "string"
52         },
53         {
54           "name": "state",
55           "in": "query",
56           "description": "Case insensitive 'starts-with' search on state",
57           "required": false,
58           "type": "string"
59         },
60         {
61           "name": "country",
62           "in": "query",
63           "description": "Case insensitive 'starts_with' search on country",
64           "required": false,
65           "type": "string"
66         },
67         {
68           "name": "phone",
69           "in": "query",
70           "description": "Case insensitive 'starts_with' search on phone number",
71           "required": false,
72           "type": "string"
73         },
74         {
75           "name": "fax",
76           "in": "query",
77           "description": "Case insensitive 'starts_with' search on fax number",
78           "required": false,
79           "type": "string"
80         },
81         {
82           "name": "email",
83           "in": "query",
84           "description": "Case insensitive 'starts_with' search on email address",
85           "required": false,
86           "type": "string"
87         },
88         {
89           "name": "reply_to_email",
90           "in": "query",
91           "description": "Case insensitive 'starts_with' search on Reply-To email address",
92           "required": false,
93           "type": "string"
94         },
95         {
96           "name": "return_path_email",
97           "in": "query",
98           "description": "Case insensitive 'starts_with' search on Return-Path email address",
99           "required": false,
100           "type": "string"
101         },
102         {
103           "name": "url",
104           "in": "query",
105           "description": "Case insensitive 'starts_with' search on website URL",
106           "required": false,
107           "type": "string"
108         },
109         {
110           "name": "ip",
111           "in": "query",
112           "description": "Case insensitive 'starts_with' search on IP address",
113           "required": false,
114           "type": "string"
115         },
116         {
117           "name": "notes",
118           "in": "query",
119           "description": "Case insensitive 'starts_with' search on notes",
120           "required": false,
121           "type": "string"
122         },
123         {
124           "name": "opac_info",
125           "in": "query",
126           "description": "Case insensitive 'starts-with' search on OPAC info",
127           "required": false,
128           "type": "string"
129         },
130         {
131           "$ref": "../parameters.json#/match"
132         },
133         {
134           "$ref": "../parameters.json#/order_by"
135         },
136         {
137           "$ref": "../parameters.json#/page"
138         },
139         {
140           "$ref": "../parameters.json#/per_page"
141         },
142         {
143           "$ref": "../parameters.json#/q_param"
144         },
145         {
146           "$ref": "../parameters.json#/q_body"
147         },
148         {
149           "$ref": "../parameters.json#/q_header"
150         }
151       ],
152       "produces": [
153         "application/json"
154       ],
155       "responses": {
156         "200": {
157           "description": "A list of libraries",
158           "schema": {
159             "type": "array",
160             "items": {
161               "$ref": "../definitions.json#/library"
162             }
163           }
164         },
165         "500": {
166           "description": "Internal error",
167           "schema": {
168             "$ref": "../definitions.json#/error"
169           }
170         },
171         "503": {
172           "description": "Under maintenance",
173           "schema": {
174             "$ref": "../definitions.json#/error"
175           }
176         }
177       },
178       "x-koha-authorization": {
179         "permissions": {
180           "catalogue": "1"
181         }
182       },
183       "x-koha-embed": [
184         "smtp_server"
185       ]
186     },
187     "post": {
188       "x-mojo-to": "Libraries#add",
189       "operationId": "addLibrary",
190       "tags": [
191         "library"
192       ],
193       "summary": "Add library",
194       "parameters": [
195         {
196           "name": "body",
197           "in": "body",
198           "description": "A JSON object containing informations about the new library",
199           "required": true,
200           "schema": {
201             "$ref": "../definitions.json#/library"
202           }
203         }
204       ],
205       "produces": [
206         "application/json"
207       ],
208       "responses": {
209         "201": {
210           "description": "Library added",
211           "schema": {
212             "$ref": "../definitions.json#/library"
213           }
214         },
215         "400": {
216           "description": "Bad request",
217           "schema": {
218             "$ref": "../definitions.json#/error"
219           }
220         },
221         "401": {
222           "description": "Authentication required",
223           "schema": {
224             "$ref": "../definitions.json#/error"
225           }
226         },
227         "403": {
228           "description": "Access forbidden",
229           "schema": {
230             "$ref": "../definitions.json#/error"
231           }
232         },
233         "409": {
234           "description": "Conflict in creating resource",
235           "schema": {
236             "$ref": "../definitions.json#/error"
237           }
238         },
239         "500": {
240           "description": "Internal error",
241           "schema": {
242             "$ref": "../definitions.json#/error"
243           }
244         },
245         "503": {
246           "description": "Under maintenance",
247           "schema": {
248             "$ref": "../definitions.json#/error"
249           }
250         }
251       },
252       "x-koha-authorization": {
253         "permissions": {
254           "parameters": "manage_libraries"
255         }
256       }
257     }
258   },
259   "/libraries/{library_id}": {
260     "get": {
261       "x-mojo-to": "Libraries#get",
262       "operationId": "getLibrary",
263       "tags": [
264         "library"
265       ],
266       "summary": "Get library",
267       "parameters": [
268         {
269           "$ref": "../parameters.json#/library_id_pp"
270         }
271       ],
272       "produces": [
273         "application/json"
274       ],
275       "responses": {
276         "200": {
277           "description": "A library",
278           "schema": {
279             "$ref": "../definitions.json#/library"
280           }
281         },
282         "404": {
283           "description": "Library not found",
284           "schema": {
285             "$ref": "../definitions.json#/error"
286           }
287         }
288       },
289       "x-koha-authorization": {
290         "permissions": {
291           "catalogue": "1"
292         }
293       },
294       "x-koha-embed": [
295         "smtp_server"
296       ]
297     },
298     "put": {
299       "x-mojo-to": "Libraries#update",
300       "operationId": "updateLibrary",
301       "tags": [
302         "library"
303       ],
304       "summary": "Update library",
305       "parameters": [
306         {
307           "$ref": "../parameters.json#/library_id_pp"
308         },
309         {
310           "name": "body",
311           "in": "body",
312           "description": "A JSON object containing information on the library",
313           "required": true,
314           "schema": {
315             "$ref": "../definitions.json#/library"
316           }
317         }
318       ],
319       "consumes": [
320         "application/json"
321       ],
322       "produces": [
323         "application/json"
324       ],
325       "responses": {
326         "200": {
327           "description": "A library",
328           "schema": {
329             "$ref": "../definitions.json#/library"
330           }
331         },
332         "400": {
333           "description": "Bad request",
334           "schema": {
335             "$ref": "../definitions.json#/error"
336           }
337         },
338         "401": {
339           "description": "Authentication required",
340           "schema": {
341             "$ref": "../definitions.json#/error"
342           }
343         },
344         "403": {
345           "description": "Access forbidden",
346           "schema": {
347             "$ref": "../definitions.json#/error"
348           }
349         },
350         "404": {
351           "description": "Library not found",
352           "schema": {
353             "$ref": "../definitions.json#/error"
354           }
355         },
356         "500": {
357           "description": "Internal error",
358           "schema": {
359             "$ref": "../definitions.json#/error"
360           }
361         },
362         "503": {
363           "description": "Under maintenance",
364           "schema": {
365             "$ref": "../definitions.json#/error"
366           }
367         }
368       },
369       "x-koha-authorization": {
370         "permissions": {
371           "parameters": "manage_libraries"
372         }
373       }
374     },
375     "delete": {
376       "x-mojo-to": "Libraries#delete",
377       "operationId": "deleteLibrary",
378       "tags": [
379         "library"
380       ],
381       "summary": "Delete library",
382       "parameters": [
383         {
384           "$ref": "../parameters.json#/library_id_pp"
385         }
386       ],
387       "produces": [
388         "application/json"
389       ],
390       "responses": {
391         "204": {
392           "description": "Library deleted",
393           "schema": {
394             "type": "string"
395           }
396         },
397         "401": {
398           "description": "Authentication required",
399           "schema": {
400             "$ref": "../definitions.json#/error"
401           }
402         },
403         "403": {
404           "description": "Access forbidden",
405           "schema": {
406             "$ref": "../definitions.json#/error"
407           }
408         },
409         "404": {
410           "description": "Library not found",
411           "schema": {
412             "$ref": "../definitions.json#/error"
413           }
414         },
415         "500": {
416           "description": "Internal error",
417           "schema": {
418             "$ref": "../definitions.json#/error"
419           }
420         },
421         "503": {
422           "description": "Under maintenance",
423           "schema": {
424             "$ref": "../definitions.json#/error"
425           }
426         }
427       },
428       "x-koha-authorization": {
429         "permissions": {
430           "parameters": "manage_libraries"
431         }
432       }
433     }
434   }
435 }