[Bug 18330] New: REST API: Date-time handling
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18330 Bug ID: 18330 Summary: REST API: Date-time handling Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Web services Assignee: koha-bugs@lists.koha-community.org Reporter: lari.taskula@jns.fi QA Contact: testopia@bugs.koha-community.org Swagger2 wants dates and date-times as defined in RFC3339, https://xml2rfc.tools.ietf.org/public/rfc/html/rfc3339.html#anchor14 Make sure each object property has a format date or date-time defined where needed. We should include information on time zone and use an appropriate separator "T" between date and time, e.g.: 2017-03-24T14:00:00+02:00 2017-03-24T12:00:00Z -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18330 --- Comment #1 from Lari Taskula <lari.taskula@jns.fi> --- Created attachment 63603 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=63603&action=edit Bug 18330: Add RFC3339 to Koha::DateUtils To test: 1. prove t/DateUtils.t -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18330 --- Comment #2 from Lari Taskula <lari.taskula@jns.fi> --- Created attachment 63604 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=63604&action=edit Bug 18330: Handle date-time in Koha::Object->TO_JSON This patch formats timestamps and datetimes to meet date-time definition in RFC3339, as required by Swagger documentation. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18330 --- Comment #3 from Lari Taskula <lari.taskula@jns.fi> --- Created attachment 63605 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=63605&action=edit Bug 18330: (follow-up) Add note to update tests when upgrading Mojolicious I noticed this test file is broken with Mojolicious 7. It is because they have replaced Mojo::JSON::_Bool with JSON::PP::Boolean. This patch adds TODO comment to easily identify the issue when updating. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18330 Lari Taskula <lari.taskula@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |16330 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16330 [Bug 16330] REST API: add routes to add, update and delete patrons -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18330 Lari Taskula <lari.taskula@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #63605|0 |1 is obsolete| | -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18330 --- Comment #4 from Lari Taskula <lari.taskula@jns.fi> --- (In reply to Lari Taskula from comment #3)
Created attachment 63605 [details] [review] Bug 18330: (follow-up) Add note to update tests when upgrading Mojolicious
I noticed this test file is broken with Mojolicious 7. It is because they have replaced Mojo::JSON::_Bool with JSON::PP::Boolean. This patch adds TODO comment to easily identify the issue when updating.
Marked this patch obsolete as it is fixed in Bug 18290. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18330 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit | |y.org | Component|Web services |REST api CC| |jonathan.druart@bugs.koha-c | |ommunity.org -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18330 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18330 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18330 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |lari.taskula@jns.fi |ity.org | QA Contact| |tomascohen@gmail.com -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18330 Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #63603|0 |1 is obsolete| | --- Comment #5 from Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no> --- Created attachment 69726 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=69726&action=edit Bug 18330: Add RFC3339 to Koha::DateUtils To test: 1. prove t/DateUtils.t Signed-off-by: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18330 Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #63604|0 |1 is obsolete| | --- Comment #6 from Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no> --- Created attachment 69727 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=69727&action=edit Bug 18330: Handle date-time in Koha::Object->TO_JSON This patch formats timestamps and datetimes to meet date-time definition in RFC3339, as required by Swagger documentation. Signed-off-by: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18330 Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |benjamin.rokseth@kul.oslo.k | |ommune.no Status|Needs Signoff |Signed Off --- Comment #7 from Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no> --- All tests pass. Good work! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18330 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #69726|0 |1 is obsolete| | --- Comment #8 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 69749 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=69749&action=edit Bug 18330: Add RFC3339 to Koha::DateUtils To test: 1. prove t/DateUtils.t Signed-off-by: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18330 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #69727|0 |1 is obsolete| | --- Comment #9 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 69750 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=69750&action=edit Bug 18330: Handle date-time in Koha::Object->TO_JSON This patch formats timestamps and datetimes to meet date-time definition in RFC3339, as required by Swagger documentation. Signed-off-by: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18330 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18330 --- Comment #10 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 69751 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=69751&action=edit Bug 18330: (follow-up) Adapt holds.t to match the new datetime format Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18330 --- Comment #11 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- What do we do if output_pref is called with dateformat => rfc3339 and dateonly => 1? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18330 --- Comment #12 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Jonathan Druart from comment #11)
What do we do if output_pref is called with dateformat => rfc3339 and dateonly => 1?
Raise an exception because RFC doesn't cover that use case? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18330 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |19816 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19816 [Bug 19816] output_pref must raised an exception if called with dateformat => rfc3339 and > dateonly => 1 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18330 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master --- Comment #13 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Pushed to master for 18.05, thanks to everybody involved! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18330 --- Comment #14 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- # Failed test 'Test::Perl::Critic for "Koha/Object.pm"' # at /usr/share/perl5/Test/Perl/Critic.pm line 110. # # Perl::Critic found these violations in "Koha/Object.pm": # "return" statement with explicit "undef" at line 227, column 17. See page 199 of PBP. (Severity: 5) # Looks like you failed 1 test of 854. [20:13:10] t/00-testcritic.t I let you deal with that one. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18330 --- Comment #15 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 69851 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=69851&action=edit Bug 18330: Do not return undef explicitely This patch fixes a perl critic issue, hopefully it will not break something else. Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18330 --- Comment #16 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Last patch has been pushed to master. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18330 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|Pushed to Master |RESOLVED CC| |nick@bywatersolutions.com --- Comment #17 from Nick Clemens <nick@bywatersolutions.com> --- Awesome work all! Enhancement, not backporting for 17.11 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18330 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=20886 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18330 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |olli-antti.kivilahti@jns.fi --- Comment #18 from Tomás Cohen Arazi <tomascohen@gmail.com> --- *** Bug 18293 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18330 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |24643 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24643 [Bug 24643] Koha::DateUtils::dt_from_string rfc3339 cannot handle high precision seconds -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18330 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |25621 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25621 [Bug 25621] Some tests in t/DateUtils.t fail when timezone is not UTC -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18330 --- Comment #19 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- This implementation is not correct, the timezone from the string should be taken into account (and UTC used if not provided). See bug 25621 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org