File tree 3 files changed +9
-4
lines changed
3 files changed +9
-4
lines changed Original file line number Diff line number Diff line change 1
1
2
2
## Unreleased
3
3
4
+ - Fix ` Search ` validation when ` datetime ` is ` None ` (#165 , @gadomski )
5
+
4
6
## 3.1.3 (2024-10-14)
5
7
6
8
- Add optional ` numberMatched ` and ` numberReturned ` to ` api.collections.Collections ` model to match the OGC Common part2 specification
121
123
- Add option to skip validation of remote extensions (#16 )
122
124
- Add helper function for item validation (#17 )
123
125
124
-
125
126
## 1.0.3 (2020-06-03)
126
127
127
128
- Bugfixes (#10 )
128
129
- Add rel types enum (#11 )
129
130
130
-
131
131
## 1.0.2 (2020-06-02)
132
132
133
133
- Add models for the STAC API spec (#7 )
134
134
135
-
136
135
## 1.0.1 (2020-05-21)
137
136
138
137
- Allow extra asset-level fields (#1 )
Original file line number Diff line number Diff line change @@ -98,8 +98,10 @@ def validate_bbox(cls, v: BBox) -> BBox:
98
98
99
99
@field_validator ("datetime" )
100
100
@classmethod
101
- def validate_datetime (cls , value : str ) -> str :
101
+ def validate_datetime (cls , value : Optional [ str ] ) -> Optional [ str ] :
102
102
# Split on "/" and replace no value or ".." with None
103
+ if value is None :
104
+ return value
103
105
values = [v if v and v != ".." else None for v in value .split ("/" )]
104
106
105
107
# If there are more than 2 dates, it's invalid
Original file line number Diff line number Diff line change @@ -149,3 +149,7 @@ def test_search_geometry_bbox():
149
149
def test_search_invalid_bbox (bbox ):
150
150
with pytest .raises (ValidationError ):
151
151
Search (collections = ["foo" ], bbox = bbox )
152
+
153
+
154
+ def test_search_none_datetime () -> None :
155
+ Search (datetime = None )
You can’t perform that action at this time.
0 commit comments