@@ -187,11 +187,7 @@ def _identify_stac_extensions(
187
187
if "links" in d :
188
188
found_checksum = False
189
189
for link in d ["links" ]:
190
- # Account for old links as dicts
191
- if isinstance (link , str ):
192
- link_props = cast (Dict [str , Any ], d ["links" ][link ]).keys ()
193
- else :
194
- link_props = cast (Dict [str , Any ], link ).keys ()
190
+ link_props = cast (Dict [str , Any ], link ).keys ()
195
191
196
192
if any (prop .startswith ("checksum:" ) for prop in link_props ):
197
193
found_checksum = True
@@ -374,15 +370,7 @@ def identify_stac_object(json_dict: Dict[str, Any]) -> STACJSONDescription:
374
370
stac_extensions = json_dict .get ("stac_extensions" , None )
375
371
376
372
if stac_version is None :
377
- if (
378
- object_type == pystac .STACObjectType .CATALOG
379
- or object_type == pystac .STACObjectType .COLLECTION
380
- ):
381
- version_range .set_max (STACVersionID ("0.5.2" ))
382
- elif object_type == pystac .STACObjectType .ITEM :
383
- version_range .set_max (STACVersionID ("0.7.0" ))
384
- else : # ItemCollection
385
- version_range .set_min (STACVersionID ("0.8.0" ))
373
+ version_range .set_min (STACVersionID ("0.8.0" ))
386
374
else :
387
375
version_range .set_to_single (stac_version )
388
376
@@ -394,7 +382,7 @@ def identify_stac_object(json_dict: Dict[str, Any]) -> STACJSONDescription:
394
382
# if the stac_extensions property doesn't exist for everything
395
383
# but ItemCollection (except after 0.9.0, when ItemCollection also got
396
384
# the stac_extensions property).
397
- if version_range . is_earlier_than ( "0.8.0" ) or (
385
+ if (
398
386
object_type == pystac .STACObjectType .ITEMCOLLECTION
399
387
and not version_range .is_later_than ("0.8.1" )
400
388
):
@@ -412,21 +400,4 @@ def identify_stac_object(json_dict: Dict[str, Any]) -> STACJSONDescription:
412
400
# code translates the short name IDs used pre-1.0.0-RC1 to the
413
401
# relevant extension schema uri identifier.
414
402
415
- if not version_range .is_single_version ():
416
- # Final Checks
417
-
418
- if "links" in json_dict :
419
- # links were a dictionary only in 0.5
420
- if "links" in json_dict and isinstance (json_dict ["links" ], dict ):
421
- version_range .set_to_single (STACVersionID ("0.5.2" ))
422
-
423
- # self links became non-required in 0.7.0
424
- if not version_range .is_earlier_than ("0.7.0" ) and not any (
425
- filter (
426
- lambda l : cast (Dict [str , Any ], l )["rel" ] == pystac .RelType .SELF ,
427
- json_dict ["links" ],
428
- )
429
- ):
430
- version_range .set_min (STACVersionID ("0.7.0" ))
431
-
432
403
return STACJSONDescription (object_type , version_range , set (stac_extensions ))
0 commit comments