stapi-spec / stapi-fastapi

Spatio Temporal Asset Tasking with FastAPI
MIT License
12 stars 4 forks source link

DatetimeInterval does not support open-ended intervals #97

Open philvarner opened 2 weeks ago

philvarner commented 2 weeks ago

STAPI allows singly open-ended intervals in query (e.g., ../2024-04-23T00:00:00Z or 2024-04-23T00:00:00Z../), but the DatetimeInterval class only validates ISO8601 datetime values. Also, the validation of the datetime values should be revisited to ensure it's tightly allowing only RFC 3339 values instead of the broader class of ISO 8601 values. There is support for this more narrow validation in pystac that can be copied.

c-wygoda commented 1 week ago

Isn't pystac also lenient on RFC339/ISO8601 using dateutil.parser.isoparse? https://github.com/stac-utils/pystac/blob/5b72d15f8245cdabe0126680f9dda673434bf525/pystac/utils.py#L397

philvarner commented 1 week ago

ah, you're right, it is lenient. That part is probably fine then.