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

(-)a/api/v1/definitions.json (+14 lines)
Line 0 Link Here
1
{
2
  "patron": {
3
    "$ref": "definitions/patron.json"
4
  },
5
  "holds": {
6
    "$ref": "definitions/holds.json"
7
  },
8
  "hold": {
9
    "$ref": "definitions/hold.json"
10
  },
11
  "error": {
12
    "$ref": "definitions/error.json"
13
  }
14
}
(-)a/api/v1/definitions/index.json (-6 lines)
Lines 1-6 Link Here
1
{
2
    "patron": { "$ref": "patron.json" },
3
    "holds": { "$ref": "holds.json" },
4
    "hold": { "$ref": "hold.json" },
5
    "error": { "$ref": "error.json" }
6
}
(-)a/api/v1/parameters.json (+8 lines)
Line 0 Link Here
1
{
2
  "borrowernumberPathParam": {
3
    "$ref": "parameters/patron.json#/borrowernumberPathParam"
4
  },
5
  "holdIdPathParam": {
6
    "$ref": "parameters/hold.json#/holdIdPathParam"
7
  }
8
}
(-)a/api/v1/parameters/hold.json (+9 lines)
Line 0 Link Here
1
{
2
  "holdIdPathParam": {
3
    "name": "reserve_id",
4
    "in": "path",
5
    "description": "Internal hold identifier",
6
    "required": true,
7
    "type": "integer"
8
  }
9
}
(-)a/api/v1/parameters/patron.json (+9 lines)
Line 0 Link Here
1
{
2
  "borrowernumberPathParam": {
3
    "name": "borrowernumber",
4
    "in": "path",
5
    "description": "Internal patron identifier",
6
    "required": true,
7
    "type": "integer"
8
  }
9
}
(-)a/api/v1/paths.json (+14 lines)
Line 0 Link Here
1
{
2
  "/holds": {
3
    "$ref": "paths/holds.json#/~1holds"
4
  },
5
  "/holds/{reserve_id}": {
6
    "$ref": "paths/holds.json#/~1holds~1{reserve_id}"
7
  },
8
  "/patrons": {
9
    "$ref": "paths/patrons.json#/~1patrons"
10
  },
11
  "/patrons/{borrowernumber}": {
12
    "$ref": "paths/patrons.json#/~1patrons~1{borrowernumber}"
13
  }
14
}
(-)a/api/v1/paths/holds.json (+283 lines)
Line 0 Link Here
1
{
2
  "/holds": {
3
    "get": {
4
      "operationId": "listHolds",
5
      "tags": ["borrowers", "holds"],
6
      "parameters": [
7
        {
8
          "name": "reserve_id",
9
          "in": "query",
10
          "description": "Internal reserve identifier",
11
          "type": "integer"
12
        },
13
        {
14
          "name": "borrowernumber",
15
          "in": "query",
16
          "description": "Internal borrower identifier",
17
          "type": "integer"
18
        },
19
        {
20
          "name": "reservedate",
21
          "in": "query",
22
          "description": "Reserve date",
23
          "type": "string"
24
        },
25
        {
26
          "name": "biblionumber",
27
          "in": "query",
28
          "description": "Internal biblio identifier",
29
          "type": "integer"
30
        },
31
        {
32
          "name": "branchcode",
33
          "in": "query",
34
          "description": "Branch code",
35
          "type": "string"
36
        },
37
        {
38
          "name": "notificationdate",
39
          "in": "query",
40
          "description": "Notification date",
41
          "type": "string"
42
        },
43
        {
44
          "name": "reminderdate",
45
          "in": "query",
46
          "description": "Reminder date",
47
          "type": "string"
48
        },
49
        {
50
          "name": "cancellationdate",
51
          "in": "query",
52
          "description": "Cancellation date",
53
          "type": "string"
54
        },
55
        {
56
          "name": "reservenotes",
57
          "in": "query",
58
          "description": "Reserve notes",
59
          "type": "string"
60
        },
61
        {
62
          "name": "priority",
63
          "in": "query",
64
          "description": "Priority",
65
          "type": "integer"
66
        },
67
        {
68
          "name": "found",
69
          "in": "query",
70
          "description": "Found status",
71
          "type": "string"
72
        },
73
        {
74
          "name": "timestamp",
75
          "in": "query",
76
          "description": "Time of latest update",
77
          "type": "string"
78
        },
79
        {
80
          "name": "itemnumber",
81
          "in": "query",
82
          "description": "Internal item identifier",
83
          "type": "integer"
84
        },
85
        {
86
          "name": "waitingdate",
87
          "in": "query",
88
          "description": "Date the item was marked as waiting for the patron",
89
          "type": "string"
90
        },
91
        {
92
          "name": "expirationdate",
93
          "in": "query",
94
          "description": "Date the hold expires",
95
          "type": "string"
96
        },
97
        {
98
          "name": "lowestPriority",
99
          "in": "query",
100
          "description": "Lowest priority",
101
          "type": "integer"
102
        },
103
        {
104
          "name": "suspend",
105
          "in": "query",
106
          "description": "Suspended",
107
          "type": "integer"
108
        },
109
        {
110
          "name": "suspend_until",
111
          "in": "query",
112
          "description": "Suspended until",
113
          "type": "string"
114
        }
115
      ],
116
      "produces": ["application/json"],
117
      "responses": {
118
        "200": {
119
          "description": "A list of holds",
120
          "schema": {
121
            "$ref": "../definitions.json#/holds"
122
          }
123
        },
124
        "404": {
125
          "description": "Borrower not found",
126
          "schema": {
127
            "$ref": "../definitions.json#/error"
128
          }
129
        }
130
      }
131
    },
132
    "post": {
133
      "operationId": "addHold",
134
      "tags": ["borrowers", "holds"],
135
      "parameters": [{
136
          "name": "body",
137
          "in": "body",
138
          "description": "A JSON object containing informations about the new hold",
139
          "required": true,
140
          "schema": {
141
            "type": "object",
142
            "properties": {
143
              "borrowernumber": {
144
                "description": "Borrower internal identifier",
145
                "type": "integer"
146
              },
147
              "biblionumber": {
148
                "description": "Biblio internal identifier",
149
                "type": "integer"
150
              },
151
              "itemnumber": {
152
                "description": "Item internal identifier",
153
                "type": "integer"
154
              },
155
              "branchcode": {
156
                "description": "Pickup location",
157
                "type": "string"
158
              },
159
              "expirationdate": {
160
                "description": "Hold end date",
161
                "type": "string",
162
                "format": "date"
163
              }
164
            }
165
          }
166
        }
167
      ],
168
      "consumes": ["application/json"],
169
      "produces": ["application/json"],
170
      "responses": {
171
        "201": {
172
          "description": "Created hold",
173
          "schema": {
174
            "$ref": "../definitions.json#/hold"
175
          }
176
        },
177
        "400": {
178
          "description": "Missing or wrong parameters",
179
          "schema": {
180
            "$ref": "../definitions.json#/error"
181
          }
182
        },
183
        "403": {
184
          "description": "Hold not allowed",
185
          "schema": {
186
            "$ref": "../definitions.json#/error"
187
          }
188
        },
189
        "404": {
190
          "description": "Borrower not found",
191
          "schema": {
192
            "$ref": "../definitions.json#/error"
193
          }
194
        },
195
        "500": {
196
          "description": "Internal error",
197
          "schema": {
198
            "$ref": "../definitions.json#/error"
199
          }
200
        }
201
      }
202
    }
203
  },
204
  "/holds/{reserve_id}": {
205
    "put": {
206
      "operationId": "editHold",
207
      "tags": ["holds"],
208
      "parameters": [{
209
          "$ref": "../parameters.json#/holdIdPathParam"
210
        }, {
211
          "name": "body",
212
          "in": "body",
213
          "description": "A JSON object containing fields to modify",
214
          "required": true,
215
          "schema": {
216
            "type": "object",
217
            "properties": {
218
              "priority": {
219
                "description": "Position in waiting queue",
220
                "type": "integer",
221
                "minimum": 1
222
              },
223
              "branchcode": {
224
                "description": "Pickup location",
225
                "type": "string"
226
              },
227
              "suspend_until": {
228
                "description": "Suspend until",
229
                "type": "string",
230
                "format": "date"
231
              }
232
            }
233
          }
234
        }
235
      ],
236
      "consumes": ["application/json"],
237
      "produces": ["application/json"],
238
      "responses": {
239
        "200": {
240
          "description": "Updated hold",
241
          "schema": {
242
            "$ref": "../definitions.json#/hold"
243
          }
244
        },
245
        "400": {
246
          "description": "Missing or wrong parameters",
247
          "schema": {
248
            "$ref": "../definitions.json#/error"
249
          }
250
        },
251
        "404": {
252
          "description": "Hold not found",
253
          "schema": {
254
            "$ref": "../definitions.json#/error"
255
          }
256
        }
257
      }
258
    },
259
    "delete": {
260
      "operationId": "deleteHold",
261
      "tags": ["holds"],
262
      "parameters": [{
263
          "$ref": "../parameters.json#/holdIdPathParam"
264
        }
265
      ],
266
      "produces": ["application/json"],
267
      "responses": {
268
        "200": {
269
          "description": "Successful deletion",
270
          "schema": {
271
            "type": "object"
272
          }
273
        },
274
        "404": {
275
          "description": "Hold not found",
276
          "schema": {
277
            "$ref": "../definitions.json#/error"
278
          }
279
        }
280
      }
281
    }
282
  }
283
}
(-)a/api/v1/paths/patrons.json (+61 lines)
Line 0 Link Here
1
{
2
  "/patrons": {
3
    "get": {
4
      "operationId": "listPatrons",
5
      "tags": ["patrons"],
6
      "produces": [
7
          "application/json"
8
      ],
9
      "responses": {
10
        "200": {
11
          "description": "A list of patrons",
12
          "schema": {
13
            "type": "array",
14
            "items": {
15
              "$ref": "../definitions.json#/patron"
16
            }
17
          }
18
        },
19
        "403": {
20
          "description": "Access forbidden",
21
          "schema": {
22
            "$ref": "../definitions.json#/error"
23
          }
24
        }
25
      }
26
    }
27
  },
28
  "/patrons/{borrowernumber}": {
29
    "get": {
30
      "operationId": "getPatron",
31
      "tags": ["patrons"],
32
      "parameters": [{
33
          "$ref": "../parameters.json#/borrowernumberPathParam"
34
        }
35
      ],
36
      "produces": [
37
          "application/json"
38
      ],
39
      "responses": {
40
        "200": {
41
          "description": "A patron",
42
          "schema": {
43
            "$ref": "../definitions.json#/patron"
44
          }
45
        },
46
        "403": {
47
          "description": "Access forbidden",
48
          "schema": {
49
            "$ref": "../definitions.json#/error"
50
          }
51
        },
52
        "404": {
53
          "description": "Patron not found",
54
          "schema": {
55
            "$ref": "../definitions.json#/error"
56
          }
57
        }
58
      }
59
    }
60
  }
61
}
(-)a/api/v1/swagger.json (-335 / +3 lines)
Lines 14-356 Link Here
14
  },
14
  },
15
  "basePath": "/api/v1",
15
  "basePath": "/api/v1",
16
  "paths": {
16
  "paths": {
17
    "/patrons": {
17
    "$ref": "paths.json"
18
      "get": {
19
        "operationId": "listPatrons",
20
        "tags": ["patrons"],
21
        "produces": [
22
          "application/json"
23
        ],
24
        "responses": {
25
          "200": {
26
            "description": "A list of patrons",
27
            "schema": {
28
              "type": "array",
29
              "items": {
30
                "$ref": "#/definitions/patron"
31
              }
32
            }
33
          },
34
          "403": {
35
            "description": "Access forbidden",
36
            "schema": {
37
              "$ref": "#/definitions/error"
38
            }
39
          }
40
        }
41
      }
42
    },
43
    "/patrons/{borrowernumber}": {
44
      "get": {
45
        "operationId": "getPatron",
46
        "tags": ["patrons"],
47
        "parameters": [
48
          {
49
            "$ref": "#/parameters/borrowernumberPathParam"
50
          }
51
        ],
52
        "produces": [
53
          "application/json"
54
        ],
55
        "responses": {
56
          "200": {
57
            "description": "A patron",
58
            "schema": {
59
              "$ref": "#/definitions/patron"
60
            }
61
          },
62
          "403": {
63
            "description": "Access forbidden",
64
            "schema": {
65
              "$ref": "#/definitions/error"
66
            }
67
          },
68
          "404": {
69
            "description": "Patron not found",
70
            "schema": {
71
              "$ref": "#/definitions/error"
72
            }
73
          }
74
        }
75
      }
76
    },
77
    "/holds": {
78
      "get": {
79
        "operationId": "listHolds",
80
        "tags": ["borrowers", "holds"],
81
        "parameters": [
82
          {
83
            "name": "reserve_id",
84
            "in": "query",
85
            "description": "Internal reserve identifier",
86
            "type": "integer"
87
          },
88
          {
89
            "name": "borrowernumber",
90
            "in": "query",
91
            "description": "Internal borrower identifier",
92
            "type": "integer"
93
          },
94
          {
95
            "name": "reservedate",
96
            "in": "query",
97
            "description": "Reserve date",
98
            "type": "string"
99
          },
100
          {
101
            "name": "biblionumber",
102
            "in": "query",
103
            "description": "Internal biblio identifier",
104
            "type": "integer"
105
          },
106
          {
107
            "name": "branchcode",
108
            "in": "query",
109
            "description": "Branch code",
110
            "type": "string"
111
          },
112
          {
113
            "name": "notificationdate",
114
            "in": "query",
115
            "description": "Notification date",
116
            "type": "string"
117
          },
118
          {
119
            "name": "reminderdate",
120
            "in": "query",
121
            "description": "Reminder date",
122
            "type": "string"
123
          },
124
          {
125
            "name": "cancellationdate",
126
            "in": "query",
127
            "description": "Cancellation date",
128
            "type": "string"
129
          },
130
          {
131
            "name": "reservenotes",
132
            "in": "query",
133
            "description": "Reserve notes",
134
            "type": "string"
135
          },
136
          {
137
            "name": "priority",
138
            "in": "query",
139
            "description": "Priority",
140
            "type": "integer"
141
          },
142
          {
143
            "name": "found",
144
            "in": "query",
145
            "description": "Found status",
146
            "type": "string"
147
          },
148
          {
149
            "name": "timestamp",
150
            "in": "query",
151
            "description": "Time of latest update",
152
            "type": "string"
153
          },
154
          {
155
            "name": "itemnumber",
156
            "in": "query",
157
            "description": "Internal item identifier",
158
            "type": "integer"
159
          },
160
          {
161
            "name": "waitingdate",
162
            "in": "query",
163
            "description": "Date the item was marked as waiting for the patron",
164
            "type": "string"
165
          },
166
          {
167
            "name": "expirationdate",
168
            "in": "query",
169
            "description": "Date the hold expires",
170
            "type": "string"
171
          },
172
          {
173
            "name": "lowestPriority",
174
            "in": "query",
175
            "description": "Lowest priority",
176
            "type": "integer"
177
          },
178
          {
179
            "name": "suspend",
180
            "in": "query",
181
            "description": "Suspended",
182
            "type": "integer"
183
          },
184
          {
185
            "name": "suspend_until",
186
            "in": "query",
187
            "description": "Suspended until",
188
            "type": "string"
189
          }
190
        ],
191
        "produces": ["application/json"],
192
        "responses": {
193
          "200": {
194
            "description": "A list of holds",
195
            "schema": { "$ref": "#/definitions/holds" }
196
          },
197
          "404": {
198
            "description": "Borrower not found",
199
            "schema": { "$ref": "#/definitions/error" }
200
          }
201
        }
202
      },
203
      "post": {
204
        "operationId": "addHold",
205
        "tags": ["borrowers", "holds"],
206
        "parameters": [
207
          {
208
            "name": "body",
209
            "in": "body",
210
            "description": "A JSON object containing informations about the new hold",
211
            "required": true,
212
            "schema": {
213
              "type": "object",
214
              "properties": {
215
                "borrowernumber": {
216
                  "description": "Borrower internal identifier",
217
                  "type": "integer"
218
                },
219
                "biblionumber": {
220
                  "description": "Biblio internal identifier",
221
                  "type": "integer"
222
                },
223
                "itemnumber": {
224
                  "description": "Item internal identifier",
225
                  "type": "integer"
226
                },
227
                "branchcode": {
228
                  "description": "Pickup location",
229
                  "type": "string"
230
                },
231
                "expirationdate": {
232
                  "description": "Hold end date",
233
                  "type": "string",
234
                  "format": "date"
235
                }
236
              }
237
            }
238
          }
239
        ],
240
        "consumes": ["application/json"],
241
        "produces": ["application/json"],
242
        "responses": {
243
          "201": {
244
            "description": "Created hold",
245
            "schema": { "$ref": "#/definitions/hold" }
246
          },
247
          "400": {
248
            "description": "Missing or wrong parameters",
249
            "schema": { "$ref": "#/definitions/error" }
250
          },
251
          "403": {
252
            "description": "Hold not allowed",
253
            "schema": { "$ref": "#/definitions/error" }
254
          },
255
          "404": {
256
            "description": "Borrower not found",
257
            "schema": { "$ref": "#/definitions/error" }
258
          },
259
          "500": {
260
            "description": "Internal error",
261
            "schema": { "$ref": "#/definitions/error" }
262
          }
263
        }
264
      }
265
    },
266
    "/holds/{reserve_id}": {
267
      "put": {
268
        "operationId": "editHold",
269
        "tags": ["holds"],
270
        "parameters": [
271
          { "$ref": "#/parameters/holdIdPathParam" },
272
          {
273
            "name": "body",
274
            "in": "body",
275
            "description": "A JSON object containing fields to modify",
276
            "required": true,
277
            "schema": {
278
              "type": "object",
279
              "properties": {
280
                "priority": {
281
                  "description": "Position in waiting queue",
282
                  "type": "integer",
283
                  "minimum": 1
284
                },
285
                "branchcode": {
286
                  "description": "Pickup location",
287
                  "type": "string"
288
                },
289
                "suspend_until": {
290
                  "description": "Suspend until",
291
                  "type": "string",
292
                  "format": "date"
293
                }
294
              }
295
            }
296
          }
297
        ],
298
        "consumes": ["application/json"],
299
        "produces": ["application/json"],
300
        "responses": {
301
          "200": {
302
            "description": "Updated hold",
303
            "schema": { "$ref": "#/definitions/hold" }
304
          },
305
          "400": {
306
            "description": "Missing or wrong parameters",
307
            "schema": { "$ref": "#/definitions/error" }
308
          },
309
          "404": {
310
            "description": "Hold not found",
311
            "schema": { "$ref": "#/definitions/error" }
312
          }
313
        }
314
      },
315
      "delete": {
316
        "operationId": "deleteHold",
317
        "tags": ["holds"],
318
        "parameters": [
319
          { "$ref": "#/parameters/holdIdPathParam" }
320
        ],
321
        "produces": ["application/json"],
322
        "responses": {
323
          "200": {
324
            "description": "Successful deletion",
325
            "schema": {
326
              "type": "object"
327
            }
328
          },
329
          "404": {
330
            "description": "Hold not found",
331
            "schema": { "$ref": "#/definitions/error" }
332
          }
333
        }
334
      }
335
    }
336
  },
18
  },
337
  "definitions": {
19
  "definitions": {
338
    "$ref": "./definitions/index.json"
20
    "$ref": "definitions.json"
339
  },
21
  },
340
  "parameters": {
22
  "parameters": {
341
    "borrowernumberPathParam": {
23
    "$ref": "parameters.json"
342
      "name": "borrowernumber",
343
      "in": "path",
344
      "description": "Internal patron identifier",
345
      "required": true,
346
      "type": "integer"
347
    },
348
    "holdIdPathParam": {
349
      "name": "reserve_id",
350
      "in": "path",
351
      "description": "Internal hold identifier",
352
      "required": true,
353
      "type": "integer"
354
    }
355
  }
24
  }
356
}
25
}
357
- 

Return to bug 16699