From bf2c6b8fbc9a29d93b4764e4ccfbaaaf5f975443 Mon Sep 17 00:00:00 2001 From: Stijn Caerts Date: Mon, 22 Apr 2024 10:20:04 +0200 Subject: [PATCH 1/2] apply datetime converter in ItemCollection endpoint model --- stac_fastapi/api/stac_fastapi/api/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stac_fastapi/api/stac_fastapi/api/models.py b/stac_fastapi/api/stac_fastapi/api/models.py index 53f376aa0..c1d70b3cf 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): From 7b2317b60a78a4c784b9502c1fdcd5bc200a786d Mon Sep 17 00:00:00 2001 From: Stijn Caerts Date: Mon, 22 Apr 2024 10:29:24 +0200 Subject: [PATCH 2/2] update changelog --- CHANGES.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 51b968156..1a5fc8494 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