Lines 1-332
Link Here
|
1 |
{ |
|
|
2 |
"/cities": { |
3 |
"get": { |
4 |
"x-mojo-to": "Cities#list", |
5 |
"operationId": "listCities", |
6 |
"tags": [ |
7 |
"cities" |
8 |
], |
9 |
"summary": "List cities", |
10 |
"produces": [ |
11 |
"application/json" |
12 |
], |
13 |
"parameters": [ |
14 |
{ |
15 |
"name": "name", |
16 |
"in": "query", |
17 |
"description": "Case insensative search on city name", |
18 |
"required": false, |
19 |
"type": "string" |
20 |
}, |
21 |
{ |
22 |
"name": "state", |
23 |
"in": "query", |
24 |
"description": "Case insensative search on city state", |
25 |
"required": false, |
26 |
"type": "string" |
27 |
}, |
28 |
{ |
29 |
"name": "country", |
30 |
"in": "query", |
31 |
"description": "Case insensative search on city country", |
32 |
"required": false, |
33 |
"type": "string" |
34 |
}, |
35 |
{ |
36 |
"name": "postal_code", |
37 |
"in": "query", |
38 |
"description": "Case Insensative search on city postal code", |
39 |
"required": false, |
40 |
"type": "string" |
41 |
}, |
42 |
{ |
43 |
"$ref": "../parameters.json#/match" |
44 |
}, |
45 |
{ |
46 |
"$ref": "../parameters.json#/order_by" |
47 |
}, |
48 |
{ |
49 |
"$ref": "../parameters.json#/page" |
50 |
}, |
51 |
{ |
52 |
"$ref": "../parameters.json#/per_page" |
53 |
}, |
54 |
{ |
55 |
"$ref": "../parameters.json#/q_param" |
56 |
}, |
57 |
{ |
58 |
"$ref": "../parameters.json#/q_body" |
59 |
}, |
60 |
{ |
61 |
"$ref": "../parameters.json#/q_header" |
62 |
} |
63 |
], |
64 |
"responses": { |
65 |
"200": { |
66 |
"description": "A list of cities", |
67 |
"schema": { |
68 |
"type": "array", |
69 |
"items": { |
70 |
"$ref": "../definitions.json#/city" |
71 |
} |
72 |
} |
73 |
}, |
74 |
"403": { |
75 |
"description": "Access forbidden", |
76 |
"schema": { |
77 |
"$ref": "../definitions.json#/error" |
78 |
} |
79 |
}, |
80 |
"500": { |
81 |
"description": "Internal error", |
82 |
"schema": { |
83 |
"$ref": "../definitions.json#/error" |
84 |
} |
85 |
}, |
86 |
"503": { |
87 |
"description": "Under maintenance", |
88 |
"schema": { |
89 |
"$ref": "../definitions.json#/error" |
90 |
} |
91 |
} |
92 |
}, |
93 |
"x-koha-authorization": { |
94 |
"permissions": { |
95 |
"catalogue": "1" |
96 |
} |
97 |
} |
98 |
}, |
99 |
"post": { |
100 |
"x-mojo-to": "Cities#add", |
101 |
"operationId": "addCity", |
102 |
"tags": [ |
103 |
"cities" |
104 |
], |
105 |
"summary": "Add city", |
106 |
"parameters": [ |
107 |
{ |
108 |
"name": "body", |
109 |
"in": "body", |
110 |
"description": "A JSON object containing informations about the new hold", |
111 |
"required": true, |
112 |
"schema": { |
113 |
"$ref": "../definitions.json#/city" |
114 |
} |
115 |
} |
116 |
], |
117 |
"produces": [ |
118 |
"application/json" |
119 |
], |
120 |
"responses": { |
121 |
"201": { |
122 |
"description": "City added", |
123 |
"schema": { |
124 |
"$ref": "../definitions.json#/city" |
125 |
} |
126 |
}, |
127 |
"401": { |
128 |
"description": "Authentication required", |
129 |
"schema": { |
130 |
"$ref": "../definitions.json#/error" |
131 |
} |
132 |
}, |
133 |
"403": { |
134 |
"description": "Access forbidden", |
135 |
"schema": { |
136 |
"$ref": "../definitions.json#/error" |
137 |
} |
138 |
}, |
139 |
"500": { |
140 |
"description": "Internal error", |
141 |
"schema": { |
142 |
"$ref": "../definitions.json#/error" |
143 |
} |
144 |
}, |
145 |
"503": { |
146 |
"description": "Under maintenance", |
147 |
"schema": { |
148 |
"$ref": "../definitions.json#/error" |
149 |
} |
150 |
} |
151 |
}, |
152 |
"x-koha-authorization": { |
153 |
"permissions": { |
154 |
"parameters": "manage_cities" |
155 |
} |
156 |
} |
157 |
} |
158 |
}, |
159 |
"/cities/{city_id}": { |
160 |
"get": { |
161 |
"x-mojo-to": "Cities#get", |
162 |
"operationId": "getCity", |
163 |
"tags": [ |
164 |
"cities" |
165 |
], |
166 |
"summary": "Get city", |
167 |
"parameters": [ |
168 |
{ |
169 |
"$ref": "../parameters.json#/city_id_pp" |
170 |
} |
171 |
], |
172 |
"produces": [ |
173 |
"application/json" |
174 |
], |
175 |
"responses": { |
176 |
"200": { |
177 |
"description": "A city", |
178 |
"schema": { |
179 |
"$ref": "../definitions.json#/city" |
180 |
} |
181 |
}, |
182 |
"404": { |
183 |
"description": "City not found", |
184 |
"schema": { |
185 |
"$ref": "../definitions.json#/error" |
186 |
} |
187 |
}, |
188 |
"500": { |
189 |
"description": "Internal error", |
190 |
"schema": { |
191 |
"$ref": "../definitions.json#/error" |
192 |
} |
193 |
}, |
194 |
"503": { |
195 |
"description": "Under maintenance", |
196 |
"schema": { |
197 |
"$ref": "../definitions.json#/error" |
198 |
} |
199 |
} |
200 |
}, |
201 |
"x-koha-authorization": { |
202 |
"permissions": { |
203 |
"catalogue": "1" |
204 |
} |
205 |
} |
206 |
}, |
207 |
"put": { |
208 |
"x-mojo-to": "Cities#update", |
209 |
"operationId": "updateCity", |
210 |
"tags": [ |
211 |
"cities" |
212 |
], |
213 |
"summary": "Update city", |
214 |
"parameters": [ |
215 |
{ |
216 |
"$ref": "../parameters.json#/city_id_pp" |
217 |
}, |
218 |
{ |
219 |
"name": "body", |
220 |
"in": "body", |
221 |
"description": "A city object", |
222 |
"required": true, |
223 |
"schema": { |
224 |
"$ref": "../definitions.json#/city" |
225 |
} |
226 |
} |
227 |
], |
228 |
"produces": [ |
229 |
"application/json" |
230 |
], |
231 |
"responses": { |
232 |
"200": { |
233 |
"description": "A city", |
234 |
"schema": { |
235 |
"$ref": "../definitions.json#/city" |
236 |
} |
237 |
}, |
238 |
"401": { |
239 |
"description": "Authentication required", |
240 |
"schema": { |
241 |
"$ref": "../definitions.json#/error" |
242 |
} |
243 |
}, |
244 |
"403": { |
245 |
"description": "Access forbidden", |
246 |
"schema": { |
247 |
"$ref": "../definitions.json#/error" |
248 |
} |
249 |
}, |
250 |
"404": { |
251 |
"description": "City not found", |
252 |
"schema": { |
253 |
"$ref": "../definitions.json#/error" |
254 |
} |
255 |
}, |
256 |
"500": { |
257 |
"description": "Internal error", |
258 |
"schema": { |
259 |
"$ref": "../definitions.json#/error" |
260 |
} |
261 |
}, |
262 |
"503": { |
263 |
"description": "Under maintenance", |
264 |
"schema": { |
265 |
"$ref": "../definitions.json#/error" |
266 |
} |
267 |
} |
268 |
}, |
269 |
"x-koha-authorization": { |
270 |
"permissions": { |
271 |
"parameters": "manage_cities" |
272 |
} |
273 |
} |
274 |
}, |
275 |
"delete": { |
276 |
"x-mojo-to": "Cities#delete", |
277 |
"operationId": "deleteCity", |
278 |
"tags": [ |
279 |
"cities" |
280 |
], |
281 |
"summary": "Delete city", |
282 |
"parameters": [ |
283 |
{ |
284 |
"$ref": "../parameters.json#/city_id_pp" |
285 |
} |
286 |
], |
287 |
"produces": [ |
288 |
"application/json" |
289 |
], |
290 |
"responses": { |
291 |
"204": { |
292 |
"description": "City deleted" |
293 |
}, |
294 |
"401": { |
295 |
"description": "Authentication required", |
296 |
"schema": { |
297 |
"$ref": "../definitions.json#/error" |
298 |
} |
299 |
}, |
300 |
"403": { |
301 |
"description": "Access forbidden", |
302 |
"schema": { |
303 |
"$ref": "../definitions.json#/error" |
304 |
} |
305 |
}, |
306 |
"404": { |
307 |
"description": "City not found", |
308 |
"schema": { |
309 |
"$ref": "../definitions.json#/error" |
310 |
} |
311 |
}, |
312 |
"500": { |
313 |
"description": "Internal error", |
314 |
"schema": { |
315 |
"$ref": "../definitions.json#/error" |
316 |
} |
317 |
}, |
318 |
"503": { |
319 |
"description": "Under maintenance", |
320 |
"schema": { |
321 |
"$ref": "../definitions.json#/error" |
322 |
} |
323 |
} |
324 |
}, |
325 |
"x-koha-authorization": { |
326 |
"permissions": { |
327 |
"parameters": "manage_cities" |
328 |
} |
329 |
} |
330 |
} |
331 |
} |
332 |
} |