Bug 26633: Add API documentation
[koha.git] / api / v1 / swagger / paths / biblios.json
1 {
2   "/biblios/{biblio_id}": {
3     "get": {
4       "x-mojo-to": "Biblios#get",
5       "operationId": "getBiblio",
6       "tags": [
7         "biblios"
8       ],
9       "parameters": [
10         {
11           "$ref": "../parameters.json#/biblio_id_pp"
12         }
13       ],
14       "produces": [
15         "application/json",
16         "application/marcxml+xml",
17         "application/marc-in-json",
18         "application/marc",
19         "text/plain"
20       ],
21       "responses": {
22         "200": {
23           "description": "A biblio"
24         },
25         "401": {
26           "description": "Authentication required",
27           "schema": {
28             "$ref": "../definitions.json#/error"
29           }
30         },
31         "403": {
32           "description": "Access forbidden",
33           "schema": {
34             "$ref": "../definitions.json#/error"
35           }
36         },
37         "404": {
38           "description": "Biblio not found",
39           "schema": {
40             "$ref": "../definitions.json#/error"
41           }
42         },
43         "406": {
44           "description": "Not acceptable",
45           "schema": {
46             "type": "array",
47             "description": "Accepted content-types",
48             "items": {
49                 "type": "string"
50             }
51           }
52         },
53         "500": {
54           "description": "Internal server error",
55           "schema": {
56             "$ref": "../definitions.json#/error"
57           }
58         },
59         "503": {
60           "description": "Under maintenance",
61           "schema": {
62             "$ref": "../definitions.json#/error"
63           }
64         }
65       },
66       "x-koha-authorization": {
67         "permissions": {
68             "catalogue": "1"
69         }
70       }
71     },
72     "delete": {
73       "x-mojo-to": "Biblios#delete",
74       "operationId": "deleteBiblio",
75       "tags": [
76         "biblios"
77       ],
78       "parameters": [
79         {
80           "$ref": "../parameters.json#/biblio_id_pp"
81         }
82       ],
83       "produces": [
84         "application/json"
85       ],
86       "responses": {
87         "204": {
88           "description": "Biblio deleted",
89           "schema": {
90             "type": "string"
91           }
92         },
93         "401": {
94           "description": "Authentication required",
95           "schema": {
96             "$ref": "../definitions.json#/error"
97           }
98         },
99         "403": {
100           "description": "Access forbidden",
101           "schema": {
102             "$ref": "../definitions.json#/error"
103           }
104         },
105         "404": {
106           "description": "Biblio not found",
107           "schema": {
108             "$ref": "../definitions.json#/error"
109           }
110         },
111         "409": {
112           "description": "Unable to perform action on biblio",
113           "schema": {
114             "$ref": "../definitions.json#/error"
115           }
116         },
117         "500": {
118           "description": "Internal error",
119           "schema": {
120             "$ref": "../definitions.json#/error"
121           }
122         },
123         "503": {
124           "description": "Under maintenance",
125           "schema": {
126             "$ref": "../definitions.json#/error"
127           }
128         }
129       },
130       "x-koha-authorization": {
131         "permissions": {
132           "editcatalogue": "edit_catalogue"
133         }
134       }
135     }
136   },
137   "/biblios/{biblio_id}/items": {
138     "get": {
139       "x-mojo-to": "Biblios#get_items",
140       "operationId": "getBiblioItems",
141       "tags": [
142         "biblios",
143         "items"
144       ],
145       "parameters": [
146         {
147           "$ref": "../parameters.json#/biblio_id_pp"
148         },
149         {
150           "$ref": "../parameters.json#/match"
151         },
152         {
153           "$ref": "../parameters.json#/order_by"
154         },
155         {
156           "$ref": "../parameters.json#/page"
157         },
158         {
159           "$ref": "../parameters.json#/per_page"
160         },
161         {
162           "$ref": "../parameters.json#/q_param"
163         },
164         {
165           "$ref": "../parameters.json#/q_body"
166         },
167         {
168           "$ref": "../parameters.json#/q_header"
169         }
170       ],
171       "consumes": [
172         "application/json"
173       ],
174       "produces": [
175         "application/json"
176       ],
177       "responses": {
178         "200": {
179           "description": "A list of the items attached to the record",
180           "schema": {
181             "type": "array",
182             "items": {
183               "$ref": "../definitions.json#/item"
184             }
185           }
186         },
187         "401": {
188           "description": "Authentication required",
189           "schema": {
190             "$ref": "../definitions.json#/error"
191           }
192         },
193         "403": {
194           "description": "Access forbidden",
195           "schema": {
196             "$ref": "../definitions.json#/error"
197           }
198         },
199         "404": {
200           "description": "Biblio not found",
201           "schema": {
202             "$ref": "../definitions.json#/error"
203           }
204         },
205         "406": {
206           "description": "Not acceptable",
207           "schema": {
208             "type": "array",
209             "description": "Accepted content-types",
210             "items": {
211                 "type": "string"
212             }
213           }
214         },
215         "500": {
216           "description": "Internal server error",
217           "schema": {
218             "$ref": "../definitions.json#/error"
219           }
220         },
221         "503": {
222           "description": "Under maintenance",
223           "schema": {
224             "$ref": "../definitions.json#/error"
225           }
226         }
227       },
228       "x-koha-authorization": {
229         "permissions": {
230             "catalogue": "1"
231         }
232       }
233     }
234   },
235   "/public/biblios/{biblio_id}": {
236     "get": {
237       "x-mojo-to": "Biblios#get_public",
238       "operationId": "getBiblioPublic",
239       "tags": [
240         "biblios"
241       ],
242       "parameters": [
243         {
244           "$ref": "../parameters.json#/biblio_id_pp"
245         }
246       ],
247       "produces": [
248         "application/marcxml+xml",
249         "application/marc-in-json",
250         "application/marc",
251         "text/plain"
252       ],
253       "responses": {
254         "200": {
255           "description": "A biblio"
256         },
257         "401": {
258           "description": "Authentication required",
259           "schema": {
260             "$ref": "../definitions.json#/error"
261           }
262         },
263         "403": {
264           "description": "Access forbidden",
265           "schema": {
266             "$ref": "../definitions.json#/error"
267           }
268         },
269         "404": {
270           "description": "Biblio not found",
271           "schema": {
272             "$ref": "../definitions.json#/error"
273           }
274         },
275         "406": {
276           "description": "Not acceptable",
277           "schema": {
278             "type": "array",
279             "description": "Accepted content-types",
280             "items": {
281                 "type": "string"
282             }
283           }
284         },
285         "500": {
286           "description": "Internal server error",
287           "schema": {
288             "$ref": "../definitions.json#/error"
289           }
290         },
291         "503": {
292           "description": "Under maintenance",
293           "schema": {
294             "$ref": "../definitions.json#/error"
295           }
296         }
297       }
298     }
299   }
300 }