diff --git a/ingest_api/runtime/src/schema_helpers.py b/ingest_api/runtime/src/schema_helpers.py index 35544ff4..3db5bf6a 100644 --- a/ingest_api/runtime/src/schema_helpers.py +++ b/ingest_api/runtime/src/schema_helpers.py @@ -40,11 +40,11 @@ def check_extent(cls, v): class TemporalExtent(BaseModel): - startdate: datetime - enddate: datetime + startdate: Union[datetime, None] + enddate: Union[datetime, None] @root_validator def check_dates(cls, v): - if v["startdate"] >= v["enddate"]: + if (v["enddate"] is not None) and (v["startdate"] >= v["enddate"]): raise ValueError("Invalid extent - startdate must be before enddate") return v