Browse Source

Bug 17927: Fix /holds and /patrons data types

This patch changes current Swagger definitions for patrons and holds to have
data types corresponding to column data types in their database tables.

To test:
1. GET http://yourlibrary/api/v1/patrons/YYY where YYY is existing borrowernumber
2. Observe that numbers / integers are in string data type.
3. Apply this patch
4. Repeat step 1.
5. Observe that numbers / integers are now actually numbers / integers.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
17.05.x
Lari Taskula 6 years ago
committed by Kyle M Hall
parent
commit
9d805b5b5f
  1. 16
      api/v1/swagger/definitions/hold.json
  2. 17
      api/v1/swagger/definitions/patron.json
  3. 11
      api/v1/swagger/x-primitives.json

16
api/v1/swagger/definitions/hold.json

@ -8,51 +8,65 @@
"$ref": "../x-primitives.json#/borrowernumber"
},
"reservedate": {
"type": ["string", "null"],
"description": "the date the hold was placed"
},
"biblionumber": {
"$ref": "../x-primitives.json#/biblionumber"
},
"branchcode": {
"$ref": "../x-primitives.json#/branchcode"
"type": ["string", "null"],
"description": "code of patron's home branch"
},
"notificationdate": {
"type": ["string", "null"],
"description": "currently unused"
},
"reminderdate": {
"type": ["string", "null"],
"description": "currently unused"
},
"cancellationdate": {
"type": ["string", "null"],
"description": "the date the hold was cancelled"
},
"reservenotes": {
"type": ["string", "null"],
"description": "notes related to this hold"
},
"priority": {
"type": ["integer", "null"],
"description": "where in the queue the patron sits"
},
"found": {
"type": ["string", "null"],
"description": "a one letter code defining what the status of the hold is after it has been confirmed"
},
"timestamp": {
"type": "string",
"description": "date and time the hold was last updated"
},
"itemnumber": {
"$ref": "../x-primitives.json#/itemnumber"
},
"waitingdate": {
"type": ["string", "null"],
"description": "the date the item was marked as waiting for the patron at the library"
},
"expirationdate": {
"type": ["string", "null"],
"description": "the date the hold expires"
},
"lowestPriority": {
"type": "integer",
"description": ""
},
"suspend": {
"type": "integer",
"description": ""
},
"suspend_until": {
"type": ["string", "null"],
"description": ""
},
"itemtype": {

17
api/v1/swagger/definitions/patron.json

@ -124,7 +124,8 @@
"description": "patron's date of birth"
},
"branchcode": {
"$ref": "../x-primitives.json#/branchcode"
"type": "string",
"description": "code of patron's home branch"
},
"categorycode": {
"type": "string",
@ -139,11 +140,11 @@
"description": "date the patron's card is set to expire"
},
"gonenoaddress": {
"type": ["string", "null"],
"type": ["integer", "null"],
"description": "set to 1 if library marked this patron as having an unconfirmed address"
},
"lost": {
"type": ["string", "null"],
"type": ["integer", "null"],
"description": "set to 1 if library marked this patron as having lost his card"
},
"debarred": {
@ -167,7 +168,7 @@
"description": "used for children to include title of guarantor"
},
"guarantorid": {
"type": ["string", "null"],
"type": ["integer", "null"],
"description": "borrowernumber used for children or professionals to link them to guarantor or organizations"
},
"borrowernotes": {
@ -187,7 +188,7 @@
"description": "patron's encrypted password"
},
"flags": {
"type": ["string", "null"],
"type": ["integer", "null"],
"description": "a number associated with the patron's permissions"
},
"userid": {
@ -251,15 +252,15 @@
"description": "the mobile phone number where the patron would like to receive notices (if SMS turned on)"
},
"sms_provider_id": {
"type": ["string", "null"],
"type": ["integer", "null"],
"description": "the provider of the mobile phone number defined in smsalertnumber"
},
"privacy": {
"type": "string",
"type": "integer",
"description": "patron's privacy settings related to their reading history"
},
"privacy_guarantor_checkouts": {
"type": "string",
"type": "integer",
"description": "controls if relatives can see this patron's checkouts"
},
"checkprevcheckout": {

11
api/v1/swagger/x-primitives.json

@ -1,16 +1,12 @@
{
"biblionumber": {
"type": "string",
"type": "integer",
"description": "internally assigned biblio identifier"
},
"borrowernumber": {
"type": "string",
"type": "integer",
"description": "internally assigned user identifier"
},
"branchcode": {
"type": ["string", "null"],
"description": "code of patron's home branch"
},
"cardnumber": {
"type": ["string", "null"],
"description": "library assigned user identifier"
@ -29,7 +25,7 @@
"description": "patron's first name"
},
"itemnumber": {
"type": ["string", "null"],
"type": ["integer", "null"],
"description": "internally assigned item identifier"
},
"phone": {
@ -37,6 +33,7 @@
"description": "primary phone number for patron's primary address"
},
"reserve_id": {
"type": "integer",
"description": "Internal hold identifier"
},
"surname": {

Loading…
Cancel
Save