Closed Skeeve closed 3 years ago
I noticed a wrong test. You had a test against. '2017-03-29\t23:02:55-12:00'
while you realy meant "2017-03-29\t23:02:55-12:00"
as you didn want to check the non-acceptance of a \
followed by t
but the non-acceptance of a tab. Fixed that.
I also added a check that the time offset is in the range of 00:00 to 23:59.
Since I messed it up, see a clean version here https://github.com/mojolicious/json-validator/pull/238
RFC3339 states that the UTC offset needs to have 2 digit hour and minute offset.
Previous regexp allows for 1+ digits so "+1:1" and "-0123456789:9876543210" would be accepted.
Summary
While using Openapi Plugin I noticed that it doesn't accept ISO timestamps. While this is fine, as Openapi spec states that the format be RFC3339, I noticed that the regexp checking the dates is too lax.
Motivation
I see no advantage in accepting wrong time offsets like 123:567.
References
Discussion on IRC. Don't know how to link to it?