diff --git a/CHANGES.md b/CHANGES.md index 51b96815..1a5fc849 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,6 +2,10 @@ ## [Unreleased] +### Fixed + +* Apply datetime converter in ItemCollection endpoint model ([#667](https://github.com/stac-utils/stac-fastapi/pull/667)) + ## [2.5.2] - 2024-04-19 ### Fixed diff --git a/stac_fastapi/api/stac_fastapi/api/models.py b/stac_fastapi/api/stac_fastapi/api/models.py index 53f376aa..c1d70b3c 100644 --- a/stac_fastapi/api/stac_fastapi/api/models.py +++ b/stac_fastapi/api/stac_fastapi/api/models.py @@ -16,6 +16,7 @@ BaseSearchGetRequest, BaseSearchPostRequest, str2bbox, + str_to_interval, ) @@ -127,7 +128,7 @@ class ItemCollectionUri(CollectionUri): limit: int = attr.ib(default=10) bbox: Optional[BBox] = attr.ib(default=None, converter=str2bbox) - datetime: Optional[DateTimeType] = attr.ib(default=None) + datetime: Optional[DateTimeType] = attr.ib(default=None, converter=str_to_interval) class POSTTokenPagination(BaseModel):