-
Notifications
You must be signed in to change notification settings - Fork 19
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
Several problems with STAC API Item Search (/search) datetime parameter validation #788
Comments
Related: #729 😟 |
At a minimum, this should be consistent with Instead, there's a custom parser that relies on I don't know that that will fix all the problems, but the examples above should be a sufficient unit test. |
Removed the comma-separated fractional seconds example, as that's not a valid RFC3339 string (only allowed in ISO8601) |
@philvarner is it correct that every 400 above should have been a 200? |
Some of these values I think should fail to parse. For example, what should a time parser make of |
You're right, that was a typo in my test. |
The only one that was accepted that shouldn't have been was Search with datetime=1985-04-12T23:20:50.Z returned status code 200 instead of 400 |
|
time-secfrac is optional, but if it does exist, it has to be a
|
from section 5.6. |
I'm not sure we can reject those -- our formatter in stac4s isn't doing anything too weird, just taking the built in ISO local formatter and making offsets a bit more flexible (and to be clear
Some comparisons --
The good news is that this means other clients are really unlikely to produce dates in this format, since everyone but Java agrees it's no good. I'm inclined to leave this since parsing all the valid strings is more important for client interop than rejecting a format no one seems to want to create. |
I'm inclined to make the acceptance of datetimes that are not RFC 3339 a warning rather than an error. We have other cases too, like cmr-stac (I think?) that accept dates and treats them like a range for an entire day. |
Describe the bug
There are several RFC3339 datetime types that are not accepted by Franklin, and a few that are accepted but should not be.
1996-12-19T16:39:57-08:00
/1985-04-12T23:20:50.52Z
or1985-04-12T23:20:50.52Z/
(either empty string `` or..
is acceptable for the open ended start or end time)1985-04-12T23:20:50.Z
All results:
Expected behavior
Valid RFC3339 datetimes are accepted, and invalid ones error with a 400 status code.
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: