Skip to content

Commit 108b5aa

Browse files
committed
use StacBaseModel model instead of StacCommonMetadata
1 parent 7b1cb44 commit 108b5aa

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

Diff for: CHANGELOG.txt

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
- Fix STAC API Query Extension operator names from ne->neq, le->lte, and ge->gte (#120, @philvarner)
1111
- Better **datetime** parsing/validation by using Pydantic native types and remove `ciso8601` requirement (#131, @eseglem)
1212
- move datetime validation in `StacCommonMetadata` model definition (#131, @eseglem)
13+
- use `StacBaseModel` as base model for `Asset` model (#148, @vincentsarago)
1314

1415
3.0.0 (2024-01-25)
1516
------------------

Diff for: stac_pydantic/shared.py

+1-8
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ def validate_start_end(self) -> Self:
171171
return self
172172

173173

174-
class Asset(StacCommonMetadata):
174+
class Asset(StacBaseModel):
175175
"""
176176
https://github.com/radiantearth/stac-spec/blob/v1.0.0/item-spec/item-spec.md#asset-object
177177
"""
@@ -185,10 +185,3 @@ class Asset(StacCommonMetadata):
185185
model_config = ConfigDict(
186186
populate_by_name=True, use_enum_values=True, extra="allow"
187187
)
188-
189-
@model_validator(mode="after")
190-
def validate_datetime_or_start_end(self) -> Self:
191-
# Overriding the parent method to avoid requiring datetime or start/end_datetime
192-
# Additional fields MAY be added on the Asset object, but are not required.
193-
# https://github.com/radiantearth/stac-spec/blob/v1.0.0/item-spec/item-spec.md#additional-fields-for-assets
194-
return self

0 commit comments

Comments
 (0)