Bug 28370: Add missing additionalProperties in spec
[koha.git] / api / v1 / swagger / paths / import_batch_profiles.json
1 {
2   "/import_batch_profiles": {
3     "get": {
4       "x-mojo-to": "ImportBatchProfiles#list",
5       "operationId": "listImportBatchProfiles",
6       "tags": [
7         "ImportBatchProfiles"
8       ],
9       "parameters": [
10         {
11           "name": "name",
12           "in": "query",
13           "description": "Search on profile's name",
14           "required": false,
15           "type": "string"
16         },
17         {
18           "$ref": "../parameters.json#/match"
19         },
20         {
21           "$ref": "../parameters.json#/order_by"
22         },
23         {
24           "$ref": "../parameters.json#/page"
25         },
26         {
27           "$ref": "../parameters.json#/per_page"
28         }
29       ],
30       "consumes": [
31         "application/json"
32       ],
33       "produces": [
34         "application/json"
35       ],
36       "responses": {
37         "200": {
38           "description": "A list of import batch profiles",
39           "schema": {
40             "$ref": "../definitions.json#/import_batch_profiles"
41           }
42         },
43         "401": {
44           "description": "Authentication required",
45           "schema": {
46             "$ref": "../definitions.json#/error"
47           }
48         },
49         "403": {
50           "description": "Access forbidden",
51           "schema": {
52             "$ref": "../definitions.json#/error"
53           }
54         },
55         "500": {
56           "description": "Internal server error",
57           "schema": {
58             "$ref": "../definitions.json#/error"
59           }
60         },
61         "503": {
62           "description": "Under maintenance",
63           "schema": {
64             "$ref": "../definitions.json#/error"
65           }
66         }
67       },
68       "x-koha-authorization": {
69         "permissions": {
70           "tools": "stage_marc_import"
71         }
72       }
73     },
74     "post": {
75       "x-mojo-to": "ImportBatchProfiles#add",
76       "operationId": "addImportBatchProfiles",
77       "tags": [
78         "ImportBatchProfiles"
79       ],
80       "parameters": [
81         {
82           "name": "body",
83           "in": "body",
84           "description": "A JSON object containing a import batch profile",
85           "required": true,
86           "schema": {
87             "type": "object",
88             "properties": {
89               "name": {
90                 "description": "name of this profile",
91                 "type": "string"
92               },
93               "matcher_id": {
94                 "description": "the id of the match rule used (matchpoints.matcher_id)",
95                 "type": ["integer", "null"]
96               },
97               "template_id": {
98                 "description": "the id of the marc modification template",
99                 "type": ["integer", "null"]
100               },
101               "overlay_action": {
102                 "description": "how to handle duplicate records",
103                 "type": ["string", "null"]
104               },
105               "nomatch_action": {
106                 "description": "how to handle records where no match is found",
107                 "type": ["string", "null"]
108               },
109               "item_action": {
110                 "description": "what to do with item records",
111                 "type": ["string", "null"]
112               },
113               "parse_items": {
114                 "description": "should items be parsed",
115                 "type": ["boolean", "null"]
116               },
117               "record_type": {
118                 "description": "type of record in the batch",
119                 "type": ["string", "null"]
120               },
121               "encoding": {
122                 "description": "file encoding",
123                 "type": ["string", "null"]
124               },
125               "format": {
126                 "description": "marc format",
127                 "type": ["string", "null"]
128               },
129               "comments": {
130                 "description": "any comments added when the file was uploaded",
131                 "type": ["string", "null"]
132               }
133             },
134             "additionalProperties": false
135           }
136         }
137       ],
138       "consumes": ["application/json"],
139       "produces": ["application/json"],
140       "responses": {
141         "201": {
142           "description": "Created Profile",
143           "schema": {
144             "$ref": "../definitions.json#/import_batch_profile"
145           }
146         },
147         "400": {
148           "description": "Missing or wrong parameters",
149           "schema": {
150             "$ref": "../definitions.json#/error"
151           }
152         },
153         "401": {
154           "description": "Authentication required",
155           "schema": {
156             "$ref": "../definitions.json#/error"
157           }
158         },
159         "403": {
160           "description": "Hold not allowed",
161           "schema": {
162             "$ref": "../definitions.json#/error"
163           }
164         },
165         "404": {
166           "description": "Borrower not found",
167           "schema": {
168             "$ref": "../definitions.json#/error"
169           }
170         },
171         "500": {
172           "description": "Internal server error",
173           "schema": {
174             "$ref": "../definitions.json#/error"
175           }
176         },
177         "503": {
178           "description": "Under maintenance",
179           "schema": {
180             "$ref": "../definitions.json#/error"
181           }
182         }
183       },
184       "x-koha-authorization": {
185         "permissions": {
186           "tools": "stage_marc_import"
187         }
188       }
189     }
190   },
191   "/import_batch_profiles/{import_batch_profile_id}": {
192     "put": {
193       "x-mojo-to": "ImportBatchProfiles#edit",
194       "operationId": "editImportBatchProfiles",
195       "tags": [
196         "ImportBatchProfiles"
197       ],
198       "parameters": [
199         {
200           "$ref": "../parameters.json#/import_batch_profile_id_pp"
201         },
202         {
203           "name": "body",
204           "in": "body",
205           "description": "A JSON object containing a import batch profile",
206           "required": true,
207           "schema": {
208             "type": "object",
209             "properties": {
210               "name": {
211                 "description": "name of this profile",
212                 "type": "string"
213               },
214               "matcher_id": {
215                 "description": "the id of the match rule used (matchpoints.matcher_id)",
216                 "type": ["integer", "null"]
217               },
218               "template_id": {
219                 "description": "the id of the marc modification template",
220                 "type": ["integer", "null"]
221               },
222               "overlay_action": {
223                 "description": "how to handle duplicate records",
224                 "type": ["string", "null"]
225               },
226               "nomatch_action": {
227                 "description": "how to handle records where no match is found",
228                 "type": ["string", "null"]
229               },
230               "item_action": {
231                 "description": "what to do with item records",
232                 "type": ["string", "null"]
233               },
234               "parse_items": {
235                 "description": "should items be parsed",
236                 "type": ["boolean", "null"]
237               },
238               "record_type": {
239                 "description": "type of record in the batch",
240                 "type": ["string", "null"]
241               },
242               "encoding": {
243                 "description": "file encoding",
244                 "type": ["string", "null"]
245               },
246               "format": {
247                 "description": "marc format",
248                 "type": ["string", "null"]
249               },
250               "comments": {
251                 "description": "any comments added when the file was uploaded",
252                 "type": ["string", "null"]
253               }
254             },
255             "additionalProperties": false
256           }
257         }
258       ],
259       "consumes": ["application/json"],
260       "produces": ["application/json"],
261       "responses": {
262         "200": {
263           "description": "Updated profile",
264           "schema": {
265             "$ref": "../definitions.json#/import_batch_profile"
266           }
267         },
268         "400": {
269           "description": "Missing or wrong parameters",
270           "schema": {
271             "$ref": "../definitions.json#/error"
272           }
273         },
274         "401": {
275           "description": "Authentication required",
276           "schema": {
277             "$ref": "../definitions.json#/error"
278           }
279         },
280         "403": {
281           "description": "Hold not allowed",
282           "schema": {
283             "$ref": "../definitions.json#/error"
284           }
285         },
286         "404": {
287           "description": "Borrower not found",
288           "schema": {
289             "$ref": "../definitions.json#/error"
290           }
291         },
292         "500": {
293           "description": "Internal server error",
294           "schema": {
295             "$ref": "../definitions.json#/error"
296           }
297         },
298         "503": {
299           "description": "Under maintenance",
300           "schema": {
301             "$ref": "../definitions.json#/error"
302           }
303         }
304       },
305       "x-koha-authorization": {
306         "permissions": {
307           "tools": "stage_marc_import"
308         }
309       }
310     },
311     "delete": {
312       "x-mojo-to": "ImportBatchProfiles#delete",
313       "operationId": "deleteImportBatchProfiles",
314       "tags": ["ImportBatchProfiles"],
315       "parameters": [{
316           "$ref": "../parameters.json#/import_batch_profile_id_pp"
317         }
318       ],
319       "produces": ["application/json"],
320       "responses": {
321         "204": {
322           "description": "Profile deleted"
323         },
324         "401": {
325           "description": "Authentication required",
326           "schema": {
327             "$ref": "../definitions.json#/error"
328           }
329         },
330         "403": {
331           "description": "Hold not allowed",
332           "schema": {
333             "$ref": "../definitions.json#/error"
334           }
335         },
336         "404": {
337           "description": "Hold not found",
338           "schema": {
339             "$ref": "../definitions.json#/error"
340           }
341         },
342         "500": {
343           "description": "Internal server error",
344           "schema": {
345             "$ref": "../definitions.json#/error"
346           }
347         },
348         "503": {
349           "description": "Under maintenance",
350           "schema": {
351             "$ref": "../definitions.json#/error"
352           }
353         }
354       },
355       "x-koha-authorization": {
356         "permissions": {
357           "tools": "stage_marc_import"
358         }
359       }
360     }
361   }
362 }