diff --git a/stapi-pydantic/CHANGELOG.md b/stapi-pydantic/CHANGELOG.md index cccae04..a107e77 100644 --- a/stapi-pydantic/CHANGELOG.md +++ b/stapi-pydantic/CHANGELOG.md @@ -8,6 +8,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), ## [Unreleased] +### Changed + +- `OrderPayload` changed so that the `geometry` and `datetime` fields are optional. This is in support of ordering non-tasked imagery (i.e. already collected imagery) where `geometry` and `datetime` are not necessary to fulfill the order. + ### Added - ProductRouter and RootRouter now have a method `url_for` that makes the link generation code slightly cleaner and diff --git a/stapi-pydantic/src/stapi_pydantic/order.py b/stapi-pydantic/src/stapi_pydantic/order.py index 4f4cd3d..e132a97 100644 --- a/stapi-pydantic/src/stapi_pydantic/order.py +++ b/stapi-pydantic/src/stapi_pydantic/order.py @@ -144,8 +144,8 @@ def __getitem__(self, index: int) -> Order[T]: class OrderPayload(BaseModel, Generic[ORP]): - datetime: DatetimeInterval = Field(examples=["2018-02-12T00:00:00Z/2018-03-18T12:31:12Z"]) - geometry: Geometry + datetime: DatetimeInterval | None = Field(examples=["2018-02-12T00:00:00Z/2018-03-18T12:31:12Z"], default=None) + geometry: Geometry | None = None # TODO: validate the CQL2 filter? filter: CQL2Filter | None = None # type: ignore [type-arg]