File tree Expand file tree Collapse file tree 3 files changed +9
-1
lines changed Expand file tree Collapse file tree 3 files changed +9
-1
lines changed Original file line number Diff line number Diff line change 18
18
### Fixed
19
19
20
20
- Make ` get_all_collections ` properly recursive ([ #1361 ] ( https://github.com/stac-utils/pystac/pull/1361 ) )
21
+ - Set ` Item::collection ` to ` None ` when there is no collection ([ #1400 ] ( https://github.com/stac-utils/pystac/pull/1400 ) )
21
22
22
23
### Removed
23
24
Original file line number Diff line number Diff line change @@ -158,7 +158,9 @@ def __init__(
158
158
self .set_self_href (href )
159
159
160
160
self .collection_id : str | None = None
161
- if collection is not None :
161
+ if collection is None :
162
+ self .collection = None
163
+ else :
162
164
if isinstance (collection , Collection ):
163
165
self .set_collection (collection )
164
166
else :
Original file line number Diff line number Diff line change @@ -692,3 +692,8 @@ def test_copy_with_unresolveable_root(item: Item) -> None:
692
692
)
693
693
)
694
694
copy .deepcopy (item )
695
+
696
+
697
+ def test_no_collection (item : Item ) -> None :
698
+ # https://github.com/stac-utils/stac-api-validator/issues/527
699
+ assert item .collection is None
You can’t perform that action at this time.
0 commit comments