Bug 29405

Summary: The patron spec for date_renewed is missing it's format definition
Product: Koha Reporter: Martin Renvoize <martin.renvoize>
Component: REST APIAssignee: Martin Renvoize <martin.renvoize>
Status: RESOLVED FIXED QA Contact: Tomás Cohen Arazi <tomascohen>
Severity: trivial    
Priority: P5 - low CC: david, fridolin.somers, kyle, tomascohen, victor
Version: master   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Text to go in the release notes:
This fix adds the date format string to the date_renewed field. This is to ensure that the date_renewed field can be correctly validated.
Version(s) released in:
21.11.00,21.05.05,20.11.12
Attachments: Bug 29405: Fix spec
Bug 29405: Fix spec
Bug 29405: Fix date_renewed attribute format in patron spec

Description Martin Renvoize 2021-11-03 13:47:03 UTC
As the title says
Comment 1 Martin Renvoize 2021-11-03 13:48:32 UTC
Created attachment 127260 [details] [review]
Bug 29405: Fix spec

This patch just adds the 'date' format string to ensure we are
validating the input/output of the date_renewed field correctly.
Comment 2 David Nind 2021-11-07 21:44:46 UTC
Created attachment 127417 [details] [review]
Bug 29405: Fix spec

This patch just adds the 'date' format string to ensure we are
validating the input/output of the date_renewed field correctly.

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 David Nind 2021-11-07 21:51:50 UTC
This is how I tested using koha-testing-docker - hope this is sufficient!

Test plan:

1. Search http://127.0.0.1:8080/api/v1/.html for date_renewed

2. You should find seven occurrences displayed like this (note that other date fields have a line with "format": "date", as part of their definition):

   "date_renewed": {
          "description": "date the patron's card was last renewed",
          "type": [
            "string",
            "null"
          ]
        },

3. Apply the patch.

4. Reload the page in step 1 and search again for date_rendered. The seven occurrences should now include "format": "date", :

   "date_renewed": {
          "description": "date the patron's card was last renewed",
          "format": "date",
          "type": [
            "string",
            "null"
          ]
        },
      
5. Sign off!
Comment 4 Tomás Cohen Arazi 2021-11-08 12:15:23 UTC
Created attachment 127445 [details] [review]
Bug 29405: Fix date_renewed attribute format in patron spec

This patch just adds the 'date' format string to ensure we are
validating the input/output of the date_renewed field correctly.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 5 Jonathan Druart 2021-11-15 11:40:22 UTC
Pushed to master for 21.11, thanks to everybody involved!
Comment 6 Kyle M Hall 2021-11-19 16:38:35 UTC
Pushed to 21.05.x for 21.05.05
Comment 7 Fridolin Somers 2021-11-20 00:17:20 UTC
Pushed to 20.11.x for 20.11.12
Comment 8 Victor Grousset/tuxayo 2021-11-22 01:44:07 UTC
Not backported to oldoldstable (20.05.x). Feel free to ask if it's needed.