Even if the RFC doesn't target date-only representations, full-date is proposed to be used in OpenAPI, so we should support it.
OpenAPI specifies a format for date-only formatted strings (1). It basically specifies that for 'date' format, the 'full-date' profile needs to be used [2] Reopening. [1] https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#dataTypeFormat [2] https://tools.ietf.org/html/rfc3339#section-5.6
Created attachment 84372 [details] [review] Bug 19816: Regression tests This patch adds tests for the rfc3339 behaviour when dateonly => 1. To test: - Run: $ kshell k$ prove t/DateUtils.t => SUCCESS: Tests pass - Apply this patch - Run: k$ prove t/DateUtils.t => FAIL: dateonly is not implemented
Created attachment 84373 [details] [review] Bug 19816: Implement dateonly for rfc3339 format This patch implements the dateonly option for the rfc3339. This is described in the OpenAPI 2.0 specification [1]. The required output format is described on RFC 3339 [2], as 'full-date'. [1] https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#dataTypeFormat [2] https://tools.ietf.org/html/rfc3339#section-5.6 To test: - Apply the regression tests patch - Run: k$ prove t/DateUtils.t => FAIL: Tests fail because dateonly is not implemented - Apply this patch - Run: k$ prove t/DateUtils.t => SUCCESS: Tests pass! - Sign off :-D
Created attachment 84393 [details] [review] Bug 19816: Regression tests This patch adds tests for the rfc3339 behaviour when dateonly => 1. To test: - Run: $ kshell k$ prove t/DateUtils.t => SUCCESS: Tests pass - Apply this patch - Run: k$ prove t/DateUtils.t => FAIL: dateonly is not implemented Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Created attachment 84394 [details] [review] Bug 19816: Implement dateonly for rfc3339 format This patch implements the dateonly option for the rfc3339. This is described in the OpenAPI 2.0 specification [1]. The required output format is described on RFC 3339 [2], as 'full-date'. [1] https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#dataTypeFormat [2] https://tools.ietf.org/html/rfc3339#section-5.6 To test: - Apply the regression tests patch - Run: k$ prove t/DateUtils.t => FAIL: Tests fail because dateonly is not implemented - Apply this patch - Run: k$ prove t/DateUtils.t => SUCCESS: Tests pass! - Sign off :-D Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Created attachment 84586 [details] [review] Bug 19816: Regression tests This patch adds tests for the rfc3339 behaviour when dateonly => 1. To test: - Run: $ kshell k$ prove t/DateUtils.t => SUCCESS: Tests pass - Apply this patch - Run: k$ prove t/DateUtils.t => FAIL: dateonly is not implemented Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 84587 [details] [review] Bug 19816: Implement dateonly for rfc3339 format This patch implements the dateonly option for the rfc3339. This is described in the OpenAPI 2.0 specification [1]. The required output format is described on RFC 3339 [2], as 'full-date'. [1] https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#dataTypeFormat [2] https://tools.ietf.org/html/rfc3339#section-5.6 To test: - Apply the regression tests patch - Run: k$ prove t/DateUtils.t => FAIL: Tests fail because dateonly is not implemented - Apply this patch - Run: k$ prove t/DateUtils.t => SUCCESS: Tests pass! - Sign off :-D Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Trivial enhancement, passes all tests. Passing QA.
Awesome work all! Pushed to master for 19.05
Pushed to 18.11.x for 18.11.03.
backported to 18.05.x for 18.05.09
Depends on Bug 18330 not in 17.11.x