stac-utils / stac-fastapi

STAC API implementation with FastAPI.
https://stac-utils.github.io/stac-fastapi/
MIT License
225 stars 99 forks source link

Invalid RFC3339 datetime #726

Closed jankovicgd closed 2 days ago

jankovicgd commented 2 days ago

Hey I am getting an error running stac-fastapi-pgstac. The datetimes in the queries below are the same and RFC compliant but for the first one I get an Invalid RFC3339 datetime. I tried investigating the code and the regex from https://github.com/stac-utils/stac-fastapi/blob/2.5.5/stac_fastapi/types/stac_fastapi/types/rfc3339.py#L10 but I couldn't come up with why it fails.

This happened on both 2.4.11 & 2.5.0.

https://stac2.hub-dev.eox.at/collections/Kompsat2-lowres/items?limit=10&bbox=86.7%2C27.55%2C86.8%2C27.6&datetime=2013-11-15T00:00:00+00:00

https://stac2.hub-dev.eox.at/collections/Kompsat2-lowres/items?limit=10&bbox=86.7%2C27.55%2C86.8%2C27.6&datetime=2013-11-15T00:00:00Z

vincentsarago commented 2 days ago

@jankovicgd you need to encode the datetime because of the +

https://stac2.hub-dev.eox.at/collections/Kompsat2-lowres/items?limit=10&bbox=86.7%2C27.55%2C86.8%2C27.6&datetime=2013-11-15T00%3A00%3A00%2B00%3A00

or

https://stac2.hub-dev.eox.at/collections/Kompsat2-lowres/items?limit=10&bbox=86.7%2C27.55%2C86.8%2C27.6&datetime=2013-11-15T00:00:00%2B00:00

jankovicgd commented 2 days ago

Thanks for quick reply, completely forgot that + is a space character.