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

(-)a/api/v1/swagger/definitions.json (+9 lines)
Lines 1-4 Link Here
1
{
1
{
2
  "availability": {
3
    "$ref": "definitions/availability.json"
4
  },
5
  "availability/biblio": {
6
    "$ref": "definitions/availability/biblio.json"
7
  },
8
  "availability/item": {
9
    "$ref": "definitions/availability/item.json"
10
  },
2
  "city": {
11
  "city": {
3
    "$ref": "definitions/city.json"
12
    "$ref": "definitions/city.json"
4
  },
13
  },
(-)a/api/v1/swagger/definitions/availability.json (+18 lines)
Line 0 Link Here
1
{
2
  "type": "object",
3
  "properties": {
4
    "available": {
5
      "type": "boolean",
6
      "description": "Availability status"
7
    },
8
    "confirmations": {
9
      "$ref": "./availability/reason.json"
10
    },
11
    "notes": {
12
      "$ref": "./availability/reason.json"
13
    },
14
    "unavailabilities": {
15
      "$ref": "./availability/reason.json"
16
    }
17
  }
18
}
(-)a/api/v1/swagger/definitions/availability/biblio.json (+18 lines)
Line 0 Link Here
1
{
2
  "type": "object",
3
  "properties": {
4
    "biblionumber": {
5
      "type": "integer",
6
      "description": "Internal biblio identifier"
7
    },
8
    "availability": {
9
      "$ref": "../availability.json"
10
    },
11
    "item_availabilities": {
12
      "type": ["array", "null"],
13
      "items": {
14
        "$ref": "../availability/item.json"
15
      }
16
    }
17
  }
18
}
(-)a/api/v1/swagger/definitions/availability/item.json (+52 lines)
Line 0 Link Here
1
{
2
  "type": "object",
3
  "properties": {
4
    "availability": {
5
      "$ref": "../availability.json"
6
    },
7
    "barcode": {
8
      "type": ["string", "null"],
9
      "description": "item barcode"
10
    },
11
    "biblioitemnumber": {
12
      "type": "integer",
13
      "description": "internally assigned biblio item identifier"
14
    },
15
    "biblionumber": {
16
      "type": "integer",
17
      "description": "internally assigned biblio identifier"
18
    },
19
    "enumchron": {
20
      "type": ["string", "null"],
21
      "description": "serial enumeration/chronology for the item"
22
    },
23
    "holdQueueLength": {
24
      "type": ["integer", "null"],
25
      "description": "number of holdings placed on title/item"
26
    },
27
    "holdingbranch": {
28
      "type": ["string", "null"],
29
      "description": "library that is currently in possession item"
30
    },
31
    "homebranch": {
32
      "type": ["string", "null"],
33
      "description": "library that owns this item"
34
    },
35
    "itemcallnumber": {
36
      "type": ["string", "null"],
37
      "description": "call number for this item"
38
    },
39
    "itemnotes": {
40
      "type": ["string", "null"],
41
      "description": "public notes on this item"
42
    },
43
    "itemnumber": {
44
      "type": "integer",
45
      "description": "internally assigned item identifier"
46
    },
47
    "location": {
48
      "type": ["string", "null"],
49
      "description": "authorized value for the shelving location for this item"
50
    }
51
  }
52
}
(-)a/api/v1/swagger/definitions/availability/reason.json (+349 lines)
Line 0 Link Here
1
{
2
  "type": "object",
3
  "properties": {
4
    "Checkout": {
5
      "type": "object",
6
      "properties": {}
7
    },
8
    "Checkout::DueDateBeforeNow": {
9
      "description": "Given due date is already in the past.",
10
      "properties": {
11
        "duedate": {
12
          "type": "string"
13
        },
14
        "now": {
15
          "type": "string"
16
        }
17
      }
18
    },
19
    "Checkout::Fee": {
20
      "type": "object",
21
      "properties": {
22
        "amount": {
23
          "type": "number",
24
          "description": "Amount of rental charge."
25
        }
26
      }
27
    },
28
    "Checkout::HighHolds": {
29
      "type": "object",
30
      "description": "Loan period shortened for high held item.",
31
      "properties": {
32
        "num_holds": {
33
          "type": "integer"
34
        },
35
        "duration": {
36
          "type": ["string", "null"]
37
        },
38
        "returndate": {
39
          "type": ["string", "null"]
40
        }
41
      }
42
    },
43
    "Checkout::InvalidDueDate": {
44
      "description": "Given due date is already in the past.",
45
      "properties": {
46
        "duedate": {
47
          "type": "string"
48
        }
49
      }
50
    },
51
    "Checkout::MaximumCheckoutsReached": {
52
      "type": "object",
53
      "properties": {
54
        "max_checkouts_allowed": {
55
          "type": "integer",
56
          "description": "Maximum number of checkouts allowed."
57
        },
58
        "current_checkout_count": {
59
          "type": "integer",
60
          "description": "Current checkout count for patron."
61
        }
62
      }
63
    },
64
    "Checkout::MaximumOnsiteCheckoutsReached": {
65
      "type": "object",
66
      "properties": {
67
        "max_onsite_checkouts": {
68
          "type": "integer",
69
          "description": "Maximum number of onsite checkouts allowed."
70
        },
71
        "current_onsite_checkouts": {
72
          "type": "integer",
73
          "description": "Current onsite checkout count for patron."
74
        }
75
      }
76
    },
77
    "Checkout::NoMoreRenewals": {
78
      "type": "object",
79
      "properties": {}
80
    },
81
    "Checkout::NoMoreRenewalForOnsiteCheckouts": {
82
      "type": "object",
83
      "properties": {}
84
    },
85
    "Checkout::OnsiteCheckoutsDisabled": {
86
      "type": "object",
87
      "properties": {}
88
    },
89
    "Checkout::OnsiteCheckoutWillBeSwitched": {
90
      "type": "object",
91
      "properties": {}
92
    },
93
    "Checkout::PreviouslyCheckedOut": {
94
      "type": "object",
95
      "properties": {}
96
    },
97
    "Checkout::Renew": {
98
      "type": "object",
99
      "properties": {}
100
    },
101
    "Checkout::BiblioAlreadyCheckedOut": {
102
      "type": "object",
103
      "properties": {}
104
    },
105
    "Checkout::CheckedOutToAnotherPatron": {
106
      "type": "object",
107
      "properties": {
108
        "borrowernumber": {
109
          "$ref": "../../x-primitives.json#/borrowernumber"
110
        },
111
        "date_due": {
112
          "type": ["string", "null"]
113
        }
114
      }
115
    },
116
    "Checkout::CheckinImpossibleInThisLibrary": {
117
      "type": "object",
118
      "properties": {
119
        "branch_to_return": {
120
          "$ref": "../../x-primitives.json#/branchcode"
121
        }
122
      }
123
    },
124
    "Hold": {
125
      "type": "object",
126
      "properties": {}
127
    },
128
    "Hold::CannotHoldFromOtherLibraries": {
129
      "type": "object",
130
      "properties": {}
131
    },
132
    "Hold::Held": {
133
      "type": "object",
134
      "properties": {
135
        "borrowernumber": {
136
          "$ref": "../../x-primitives.json#/borrowernumber"
137
        },
138
        "hold_queue_length": {
139
          "type": "integer"
140
        }
141
      }
142
    },
143
    "Hold::HeldForThisPatron": {
144
      "type": "object",
145
      "properties": {}
146
    },
147
    "Hold::MaximumHoldsReached": {
148
      "type": "object",
149
      "properties": {
150
        "max_holds_allowed": {
151
          "type": "integer"
152
        },
153
        "current_hold_count": {
154
          "type": "integer"
155
        }
156
      }
157
    },
158
    "Hold::MaximumHoldsForThisRecordReached": {
159
      "type": "object",
160
      "properties": {
161
        "max_holds_allowed": {
162
          "type": "integer"
163
        },
164
        "current_hold_count": {
165
          "type": "integer"
166
        }
167
      }
168
    },
169
    "Hold::NotHoldable": {
170
      "type": "object",
171
      "properties": {}
172
    },
173
    "Hold::Waiting": {
174
      "type": "object",
175
      "properties": {
176
        "borrowernumber": {
177
          "$ref": "../../x-primitives.json#/borrowernumber"
178
        }
179
      }
180
    },
181
    "Item": {
182
      "type": "object",
183
      "properties": {}
184
    },
185
    "Item::Damaged": {
186
      "type": "object",
187
      "properties": {}
188
    },
189
    "Item::FromAnotherLibrary": {
190
      "type": "object",
191
      "properties": {
192
        "itemhomebranch": {
193
          "type": ["string", "null"]
194
        }
195
      }
196
    },
197
    "Item::Lost": {
198
      "type": "object",
199
      "properties": {
200
        "code": {
201
          "type": ["string", "null"]
202
        }
203
      }
204
    },
205
    "Item::NotForLoan": {
206
      "type": "object",
207
      "properties": {
208
        "notforloan": {
209
          "type": ["integer", "null"]
210
        }
211
      }
212
    },
213
    "Item::NotForLoanForcing": {
214
      "type": "object",
215
      "properties": {
216
        "notforloan": {
217
          "type": ["integer", "null"]
218
        }
219
      }
220
    },
221
    "Item::Ordered": {
222
      "type": "object",
223
      "properties": {}
224
    },
225
    "Item::Restricted": {
226
      "type": "object",
227
      "properties": {}
228
    },
229
    "Item::UnknownBarcode": {
230
      "type": "object",
231
      "properties": {
232
        "barcode": {
233
          "type": ["string", "null"]
234
        }
235
      }
236
    },
237
    "Item::Withdrawn": {
238
      "type": "object",
239
      "properties": {}
240
    },
241
    "ItemType": {
242
      "type": "object",
243
      "properties": {}
244
    },
245
    "ItemType::NotForLoan": {
246
      "type": "object",
247
      "properties": {
248
        "notforloan": {
249
          "type": ["integer", "null"]
250
        }
251
      }
252
    },
253
    "ItemType::Ordered": {
254
      "type": "object",
255
      "properties": {}
256
    },
257
    "Patron": {
258
      "type": "object",
259
      "properties": {}
260
    },
261
    "Patron::AgeRestricted": {
262
      "type": "object",
263
      "properties": {
264
        "age_restriction": {
265
          "type": ["string", "null"],
266
          "description": "Age restriction, e.g. PEGI 16"
267
        }
268
      }
269
    },
270
    "Patron::CardExpired": {
271
      "type": "object",
272
      "properties": {
273
        "expiration_date": {
274
          "type": ["string", "null"]
275
        }
276
      }
277
    },
278
    "Patron::CardLost": {
279
      "type": "object",
280
      "properties": {}
281
    },
282
    "Patron::Debarred": {
283
      "type": "object",
284
      "properties": {
285
        "expiration_date": {
286
          "type": ["string", "null"]
287
        }
288
      }
289
    },
290
    "Patron::DebarredOverdue": {
291
      "type": "object",
292
      "properties": {}
293
    },
294
    "Patron::Debt": {
295
      "type": "object",
296
      "properties": {
297
        "maximum_allowed":{
298
          "type": ["number", "null"]
299
        },
300
        "outstanding": {
301
          "type": ["number", "null"]
302
        }
303
      }
304
    },
305
    "Patron::DebtGuarantees": {
306
      "type": "object",
307
      "properties": {
308
        "maximum_allowed":{
309
          "type": ["number", "null"]
310
        },
311
        "outstanding": {
312
          "type": ["number", "null"]
313
        },
314
        "guarantees": {
315
          "type": "array",
316
          "items": {
317
              "$ref": "../../x-primitives.json#/borrowernumber"
318
          }
319
        }
320
      }
321
    },
322
    "Patron::FromAnotherLibrary": {
323
      "type": "object",
324
      "properties": {
325
        "patron_branch": {
326
          "$ref": "../../x-primitives.json#/branchcode"
327
        },
328
        "current_branch": {
329
          "$ref": "../../x-primitives.json#/branchcode"
330
        }
331
      }
332
    },
333
    "Patron::GoneNoAddress": {
334
      "type": "object",
335
      "properties": {}
336
    },
337
    "Patron::OtherCharges": {
338
      "type": "object",
339
      "properties": {
340
        "balance":{
341
          "type": ["number", "null"]
342
        },
343
        "other_charges": {
344
          "type": ["number", "null"]
345
        }
346
      }
347
    }
348
  }
349
}
(-)a/api/v1/swagger/parameters.json (+9 lines)
Lines 1-10 Link Here
1
{
1
{
2
  "biblionumbersQueryParam": {
3
    "$ref": "parameters/biblio.json#/biblionumbersQueryParam"
4
  },
2
  "borrowernumberPathParam": {
5
  "borrowernumberPathParam": {
3
    "$ref": "parameters/patron.json#/borrowernumberPathParam"
6
    "$ref": "parameters/patron.json#/borrowernumberPathParam"
4
  },
7
  },
5
  "borrowernumberQueryParam": {
8
  "borrowernumberQueryParam": {
6
    "$ref": "parameters/patron.json#/borrowernumberQueryParam"
9
    "$ref": "parameters/patron.json#/borrowernumberQueryParam"
7
  },
10
  },
11
  "branchcodeQueryParam": {
12
    "$ref": "parameters/library.json#/branchcodeQueryParam"
13
  },
8
  "cityidPathParam": {
14
  "cityidPathParam": {
9
    "$ref": "parameters/city.json#/cityidPathParam"
15
    "$ref": "parameters/city.json#/cityidPathParam"
10
  },
16
  },
Lines 13-17 Link Here
13
  },
19
  },
14
  "itemnumberPathParam": {
20
  "itemnumberPathParam": {
15
    "$ref": "parameters/item.json#/itemnumberPathParam"
21
    "$ref": "parameters/item.json#/itemnumberPathParam"
22
  },
23
  "itemnumbersQueryParam": {
24
    "$ref": "parameters/item.json#/itemnumbersQueryParam"
16
  }
25
  }
17
}
26
}
(-)a/api/v1/swagger/parameters/biblio.json (+12 lines)
Line 0 Link Here
1
{
2
  "biblionumbersQueryParam": {
3
    "name": "biblionumber",
4
    "in": "query",
5
    "description": "Internal biblios identifier",
6
    "type": "array",
7
    "items": {
8
      "type": "integer"
9
    },
10
    "collectionFormat": "ssv"
11
  }
12
}
(-)a/api/v1/swagger/parameters/item.json (+10 lines)
Lines 5-9 Link Here
5
    "description": "Internal item identifier",
5
    "description": "Internal item identifier",
6
    "required": true,
6
    "required": true,
7
    "type": "integer"
7
    "type": "integer"
8
  },
9
  "itemnumbersQueryParam": {
10
    "name": "itemnumber",
11
    "in": "query",
12
    "description": "Internal items identifier",
13
    "type": "array",
14
    "items": {
15
      "type": "integer"
16
    },
17
    "collectionFormat": "ssv"
8
  }
18
  }
9
}
19
}
(-)a/api/v1/swagger/parameters/library.json (+8 lines)
Line 0 Link Here
1
{
2
  "branchcodeQueryParam": {
3
    "name": "branchcode",
4
    "in": "query",
5
    "description": "Branch identifier code",
6
    "type": "string"
7
  }
8
}
(-)a/api/v1/swagger/paths.json (+15 lines)
Lines 1-4 Link Here
1
{
1
{
2
  "/availability/biblio/hold": {
3
    "$ref": "paths/availability.json#/~1availability~1biblio~1hold"
4
  },
5
  "/availability/biblio/search": {
6
    "$ref": "paths/availability.json#/~1availability~1biblio~1search"
7
  },
8
  "/availability/item/checkout": {
9
    "$ref": "paths/availability.json#/~1availability~1item~1checkout"
10
  },
11
  "/availability/item/hold": {
12
    "$ref": "paths/availability.json#/~1availability~1item~1hold"
13
  },
14
  "/availability/item/search": {
15
    "$ref": "paths/availability.json#/~1availability~1item~1search"
16
  },
2
  "/cities": {
17
  "/cities": {
3
    "$ref": "paths/cities.json#/~1cities"
18
    "$ref": "paths/cities.json#/~1cities"
4
  },
19
  },
(-)a/api/v1/swagger/paths/availability.json (-1 / +203 lines)
Line 0 Link Here
0
- 
1
{
2
  "/availability/biblio/hold": {
3
    "get": {
4
      "operationId": "holdBiblioAvailability",
5
      "tags": ["items", "availability"],
6
      "parameters": [
7
        { "$ref": "../parameters.json#/biblionumbersQueryParam" },
8
        { "$ref": "../parameters.json#/borrowernumberQueryParam" },
9
        { "$ref": "../parameters.json#/branchcodeQueryParam"}
10
      ],
11
      "consumes": ["application/json"],
12
      "produces": ["application/json"],
13
      "responses": {
14
        "200": {
15
          "description": "Hold availability information for items of biblio.",
16
          "schema": {
17
            "type": "array",
18
            "items": { "$ref": "../definitions.json#/availability~1biblio" }
19
          }
20
        },
21
        "400": {
22
          "description": "Missing or invalid parameters",
23
          "schema": {
24
            "$ref": "../definitions.json#/error"
25
          }
26
        },
27
        "401": {
28
          "description": "Authentication required",
29
          "schema": {
30
            "$ref": "../definitions.json#/error"
31
          }
32
        },
33
        "403": {
34
          "description": "Forbidden",
35
          "schema": {
36
            "$ref": "../definitions.json#/error"
37
          }
38
        },
39
        "500": {
40
          "description": "Internal server error",
41
          "schema": {
42
            "$ref": "../definitions.json#/error"
43
          }
44
        }
45
      }
46
    }
47
  },
48
  "/availability/biblio/search": {
49
    "get": {
50
      "operationId": "searchBiblioAvailability",
51
      "tags": ["items", "availability"],
52
      "parameters": [
53
        { "$ref": "../parameters.json#/biblionumbersQueryParam" }
54
      ],
55
      "consumes": ["application/json"],
56
      "produces": ["application/json"],
57
      "responses": {
58
        "200": {
59
          "description": "Availability information in search context for items of biblio.",
60
          "schema": {
61
            "type": "array",
62
            "items": { "$ref": "../definitions.json#/availability~1biblio" }
63
          }
64
        },
65
        "400": {
66
          "description": "Missing or invalid parameters",
67
          "schema": {
68
            "$ref": "../definitions.json#/error"
69
          }
70
        },
71
        "500": {
72
          "description": "Internal server error",
73
          "schema": {
74
            "$ref": "../definitions.json#/error"
75
          }
76
        }
77
      }
78
    }
79
  },
80
  "/availability/item/checkout": {
81
    "get": {
82
      "operationId": "checkoutItemAvailability",
83
      "tags": ["items", "availability"],
84
      "parameters": [
85
        { "$ref": "../parameters.json#/itemnumbersQueryParam" },
86
        { "$ref": "../parameters.json#/borrowernumberQueryParam" }
87
      ],
88
      "consumes": ["application/json"],
89
      "produces": ["application/json"],
90
      "responses": {
91
        "200": {
92
          "description": "Checkout availability information for specific item(s).",
93
          "schema": {
94
            "type": "array",
95
            "items": { "$ref": "../definitions.json#/availability~1item" }
96
          }
97
        },
98
        "400": {
99
          "description": "Missing or invalid parameters",
100
          "schema": {
101
            "$ref": "../definitions.json#/error"
102
          }
103
        },
104
        "401": {
105
          "description": "Authentication required",
106
          "schema": {
107
            "$ref": "../definitions.json#/error"
108
          }
109
        },
110
        "403": {
111
          "description": "Forbidden",
112
          "schema": {
113
            "$ref": "../definitions.json#/error"
114
          }
115
        },
116
        "500": {
117
          "description": "Internal server error",
118
          "schema": {
119
            "$ref": "../definitions.json#/error"
120
          }
121
        }
122
      }
123
    }
124
  },
125
  "/availability/item/hold": {
126
    "get": {
127
      "operationId": "holdItemAvailability",
128
      "tags": ["items", "availability"],
129
      "parameters": [
130
        { "$ref": "../parameters.json#/itemnumbersQueryParam" },
131
        { "$ref": "../parameters.json#/borrowernumberQueryParam" },
132
        { "$ref": "../parameters.json#/branchcodeQueryParam"}
133
      ],
134
      "consumes": ["application/json"],
135
      "produces": ["application/json"],
136
      "responses": {
137
        "200": {
138
          "description": "Hold availability information for specific item(s).",
139
          "schema": {
140
            "type": "array",
141
            "items": { "$ref": "../definitions.json#/availability~1item" }
142
          }
143
        },
144
        "400": {
145
          "description": "Missing or invalid parameters",
146
          "schema": {
147
            "$ref": "../definitions.json#/error"
148
          }
149
        },
150
        "401": {
151
          "description": "Authentication required",
152
          "schema": {
153
            "$ref": "../definitions.json#/error"
154
          }
155
        },
156
        "403": {
157
          "description": "Forbidden",
158
          "schema": {
159
            "$ref": "../definitions.json#/error"
160
          }
161
        },
162
        "500": {
163
          "description": "Internal server error",
164
          "schema": {
165
            "$ref": "../definitions.json#/error"
166
          }
167
        }
168
      }
169
    }
170
  },
171
  "/availability/item/search": {
172
    "get": {
173
      "operationId": "searchItemAvailability",
174
      "tags": ["items", "availability"],
175
      "parameters": [
176
        { "$ref": "../parameters.json#/itemnumbersQueryParam" }
177
      ],
178
      "consumes": ["application/json"],
179
      "produces": ["application/json"],
180
      "responses": {
181
        "200": {
182
          "description": "Availability information in search context for specific item(s).",
183
          "schema": {
184
            "type": "array",
185
            "items": { "$ref": "../definitions.json#/availability~1item" }
186
          }
187
        },
188
        "400": {
189
          "description": "Missing or invalid parameters",
190
          "schema": {
191
            "$ref": "../definitions.json#/error"
192
          }
193
        },
194
        "500": {
195
          "description": "Internal server error",
196
          "schema": {
197
            "$ref": "../definitions.json#/error"
198
          }
199
        }
200
      }
201
    }
202
  }
203
}

Return to bug 16826