View | Details | Raw Unified | Return to bug 29072
Collapse All | Expand All

(-)a/api/v1/swagger/definitions.json (-1 / +1 lines)
Lines 12-18 Link Here
12
    "$ref": "definitions/circ-rule-kind.json"
12
    "$ref": "definitions/circ-rule-kind.json"
13
  },
13
  },
14
  "city": {
14
  "city": {
15
    "$ref": "definitions/city.json"
15
    "$ref": "definitions/city.yaml"
16
  },
16
  },
17
  "error": {
17
  "error": {
18
    "$ref": "definitions/error.json"
18
    "$ref": "definitions/error.json"
(-)a/api/v1/swagger/definitions/city.json (-26 lines)
Lines 1-26 Link Here
1
{
2
  "type": "object",
3
  "properties": {
4
    "city_id": {
5
      "$ref": "../x-primitives.json#/city_id"
6
    },
7
    "name": {
8
      "description": "city name",
9
      "type": "string"
10
    },
11
    "state": {
12
      "description": "city state",
13
      "type": ["string", "null"]
14
    },
15
    "postal_code": {
16
      "description": "city postal code",
17
      "type": ["string", "null"]
18
    },
19
    "country": {
20
      "description": "city country",
21
      "type": ["string", "null"]
22
    }
23
  },
24
  "additionalProperties": false,
25
  "required": ["name", "state", "postal_code", "country"]
26
}
(-)a/api/v1/swagger/definitions/city.yaml (+29 lines)
Line 0 Link Here
1
---
2
type: object
3
properties:
4
  city_id:
5
    $ref: ../x-primitives.json#/city_id
6
  name:
7
    description: city name
8
    type: string
9
  state:
10
    description: city state
11
    type:
12
      - string
13
      - "null"
14
  postal_code:
15
    description: city postal code
16
    type:
17
      - string
18
      - "null"
19
  country:
20
    description: city country
21
    type:
22
      - string
23
      - "null"
24
additionalProperties: false
25
required:
26
  - name
27
  - state
28
  - postal_code
29
  - country
(-)a/api/v1/swagger/paths.json (-2 / +2 lines)
Lines 45-54 Link Here
45
    "$ref": "paths/circulation-rules.json#/~1circulation-rules~1kinds"
45
    "$ref": "paths/circulation-rules.json#/~1circulation-rules~1kinds"
46
  },
46
  },
47
  "/cities": {
47
  "/cities": {
48
    "$ref": "paths/cities.json#/~1cities"
48
    "$ref": "paths/cities.yaml#/~1cities"
49
  },
49
  },
50
  "/cities/{city_id}": {
50
  "/cities/{city_id}": {
51
    "$ref": "paths/cities.json#/~1cities~1{city_id}"
51
    "$ref": "paths/cities.yaml#/~1cities~1{city_id}"
52
  },
52
  },
53
  "/clubs/{club_id}/holds": {
53
  "/clubs/{club_id}/holds": {
54
    "$ref": "paths/clubs.json#/~1clubs~1{club_id}~1holds"
54
    "$ref": "paths/clubs.json#/~1clubs~1{club_id}~1holds"
(-)a/api/v1/swagger/paths/cities.json (-332 lines)
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
}
(-)a/api/v1/swagger/paths/cities.yaml (-1 / +210 lines)
Line 0 Link Here
0
- 
1
---
2
/cities:
3
  get:
4
    x-mojo-to: Cities#list
5
    operationId: listCities
6
    tags:
7
      - cities
8
    summary: List cities
9
    produces:
10
      - application/json
11
    parameters:
12
      - name: name
13
        in: query
14
        description: Case insensative search on city name
15
        required: false
16
        type: string
17
      - name: state
18
        in: query
19
        description: Case insensative search on city state
20
        required: false
21
        type: string
22
      - name: country
23
        in: query
24
        description: Case insensative search on city country
25
        required: false
26
        type: string
27
      - name: postal_code
28
        in: query
29
        description: Case Insensative search on city postal code
30
        required: false
31
        type: string
32
      - $ref: ../parameters.json#/match
33
      - $ref: ../parameters.json#/order_by
34
      - $ref: ../parameters.json#/page
35
      - $ref: ../parameters.json#/per_page
36
      - $ref: ../parameters.json#/q_param
37
      - $ref: ../parameters.json#/q_body
38
      - $ref: ../parameters.json#/q_header
39
    responses:
40
      "200":
41
        description: A list of cities
42
        schema:
43
          type: array
44
          items:
45
            $ref: ../definitions.json#/city
46
      "403":
47
        description: Access forbidden
48
        schema:
49
          $ref: ../definitions.json#/error
50
      "500":
51
        description: Internal error
52
        schema:
53
          $ref: ../definitions.json#/error
54
      "503":
55
        description: Under maintenance
56
        schema:
57
          $ref: ../definitions.json#/error
58
    x-koha-authorization:
59
      permissions:
60
        catalogue: "1"
61
  post:
62
    x-mojo-to: Cities#add
63
    operationId: addCity
64
    tags:
65
      - cities
66
    summary: Add city
67
    parameters:
68
      - name: body
69
        in: body
70
        description: A JSON object containing informations about the new hold
71
        required: true
72
        schema:
73
          $ref: ../definitions.json#/city
74
    produces:
75
      - application/json
76
    responses:
77
      "201":
78
        description: City added
79
        schema:
80
          $ref: ../definitions.json#/city
81
      "401":
82
        description: Authentication required
83
        schema:
84
          $ref: ../definitions.json#/error
85
      "403":
86
        description: Access forbidden
87
        schema:
88
          $ref: ../definitions.json#/error
89
      "500":
90
        description: Internal error
91
        schema:
92
          $ref: ../definitions.json#/error
93
      "503":
94
        description: Under maintenance
95
        schema:
96
          $ref: ../definitions.json#/error
97
    x-koha-authorization:
98
      permissions:
99
        parameters: manage_cities
100
"/cities/{city_id}":
101
  get:
102
    x-mojo-to: Cities#get
103
    operationId: getCity
104
    tags:
105
      - cities
106
    summary: Get city
107
    parameters:
108
      - $ref: ../parameters.json#/city_id_pp
109
    produces:
110
      - application/json
111
    responses:
112
      "200":
113
        description: A city
114
        schema:
115
          $ref: ../definitions.json#/city
116
      "404":
117
        description: City not found
118
        schema:
119
          $ref: ../definitions.json#/error
120
      "500":
121
        description: Internal error
122
        schema:
123
          $ref: ../definitions.json#/error
124
      "503":
125
        description: Under maintenance
126
        schema:
127
          $ref: ../definitions.json#/error
128
    x-koha-authorization:
129
      permissions:
130
        catalogue: "1"
131
  put:
132
    x-mojo-to: Cities#update
133
    operationId: updateCity
134
    tags:
135
      - cities
136
    summary: Update city
137
    parameters:
138
      - $ref: ../parameters.json#/city_id_pp
139
      - name: body
140
        in: body
141
        description: A city object
142
        required: true
143
        schema:
144
          $ref: ../definitions.json#/city
145
    produces:
146
      - application/json
147
    responses:
148
      "200":
149
        description: A city
150
        schema:
151
          $ref: ../definitions.json#/city
152
      "401":
153
        description: Authentication required
154
        schema:
155
          $ref: ../definitions.json#/error
156
      "403":
157
        description: Access forbidden
158
        schema:
159
          $ref: ../definitions.json#/error
160
      "404":
161
        description: City not found
162
        schema:
163
          $ref: ../definitions.json#/error
164
      "500":
165
        description: Internal error
166
        schema:
167
          $ref: ../definitions.json#/error
168
      "503":
169
        description: Under maintenance
170
        schema:
171
          $ref: ../definitions.json#/error
172
    x-koha-authorization:
173
      permissions:
174
        parameters: manage_cities
175
  delete:
176
    x-mojo-to: Cities#delete
177
    operationId: deleteCity
178
    tags:
179
      - cities
180
    summary: Delete city
181
    parameters:
182
      - $ref: ../parameters.json#/city_id_pp
183
    produces:
184
      - application/json
185
    responses:
186
      "204":
187
        description: City deleted
188
      "401":
189
        description: Authentication required
190
        schema:
191
          $ref: ../definitions.json#/error
192
      "403":
193
        description: Access forbidden
194
        schema:
195
          $ref: ../definitions.json#/error
196
      "404":
197
        description: City not found
198
        schema:
199
          $ref: ../definitions.json#/error
200
      "500":
201
        description: Internal error
202
        schema:
203
          $ref: ../definitions.json#/error
204
      "503":
205
        description: Under maintenance
206
        schema:
207
          $ref: ../definitions.json#/error
208
    x-koha-authorization:
209
      permissions:
210
        parameters: manage_cities

Return to bug 29072