Bugzilla – Attachment 59386 Details for
Bug 17927
REST API: /holds and /patrons attributes have wrong types
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17927: Fix /holds and /patrons data types
Bug-17927-Fix-holds-and-patrons-data-types.patch (text/plain), 6.43 KB, created by
Tomás Cohen Arazi
on 2017-01-20 18:52:25 UTC
(
hide
)
Description:
Bug 17927: Fix /holds and /patrons data types
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi
Created:
2017-01-20 18:52:25 UTC
Size:
6.43 KB
patch
obsolete
>From 53c6c010f2c8a7b2b5e4be38644bbe65586ee188 Mon Sep 17 00:00:00 2001 >From: Lari Taskula <larit@student.uef.fi> >Date: Tue, 16 Aug 2016 13:37:29 +0300 >Subject: [PATCH] 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> >--- > api/v1/swagger/definitions/hold.json | 16 +++++++++++++++- > api/v1/swagger/definitions/patron.json | 17 +++++++++-------- > api/v1/swagger/x-primitives.json | 11 ++++------- > 3 files changed, 28 insertions(+), 16 deletions(-) > >diff --git a/api/v1/swagger/definitions/hold.json b/api/v1/swagger/definitions/hold.json >index 870392094b..a1d82fabb1 100644 >--- a/api/v1/swagger/definitions/hold.json >+++ b/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": { >diff --git a/api/v1/swagger/definitions/patron.json b/api/v1/swagger/definitions/patron.json >index c93c4baeb5..6becabcef2 100644 >--- a/api/v1/swagger/definitions/patron.json >+++ b/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": { >diff --git a/api/v1/swagger/x-primitives.json b/api/v1/swagger/x-primitives.json >index 1b90b30c46..ded911f3f0 100644 >--- a/api/v1/swagger/x-primitives.json >+++ b/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": { >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 17927
: 59386 |
59387
|
59388
|
59899