Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Time scalar validation is too strict #469

Closed
robross0606 opened this issue Sep 1, 2020 · 3 comments
Closed

Time scalar validation is too strict #469

robross0606 opened this issue Sep 1, 2020 · 3 comments

Comments

@robross0606
Copy link

robross0606 commented Sep 1, 2020

The regex used to validate ISO8601 times is more strict than the general standard. For example, the timezone offset is supposed to be optional. You also do not allow specification of hours without minutes or minutes without seconds. It also does not allow lower case "z" or "t" as per the RFC 3339 spec..

@ardatan
Copy link
Collaborator

ardatan commented Sep 2, 2020

I think RFC 3339 doesn't allow lowercase, does it?

@robross0606
Copy link
Author

robross0606 commented Sep 3, 2020

https://tools.ietf.org/html/rfc3339#page-10

 NOTE: Per [ABNF] and ISO8601, the "T" and "Z" characters in this
  syntax may alternatively be lower case "t" or "z" respectively.

  This date/time format may be used in some environments or contexts
  that distinguish between the upper- and lower-case letters 'A'-'Z'
  and 'a'-'z' (e.g. XML).  Specifications that use this format in
  such environments MAY further limit the date/time syntax so that
  the letters 'T' and 'Z' used in the date/time syntax must always
  be upper case.  Applications that generate this format SHOULD use
  upper case letters.

  NOTE: ISO 8601 defines date and time separated by "T".
  Applications using this syntax may choose, for the sake of
  readability, to specify a full-date and full-time separated by
  (say) a space character.

But 5.6 of the spec is essentially a much more restricted version of RFC 3339. I at first didn't notice you're specifically implementing only section 5.6 of the larger RFC 3339 specification.

In my opinion, this specification waffles back and forth between "may" and "should" without ever being clear about what to expect. It is all over the place in terms of whether it wants to be strict or not.

ardatan added a commit that referenced this issue Apr 24, 2021
* Add tests for #826

* Support lower case date time strings #469

* Update Node on CI
@ardatan
Copy link
Collaborator

ardatan commented Apr 24, 2021

Fixed in the latest version!

@ardatan ardatan closed this as completed Apr 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants