Skip to content

Commit 92960a0

Browse files
committed
Handle STAC items without bbox
1 parent f000e9a commit 92960a0

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/stac_api_validator/validations.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3235,12 +3235,13 @@ def _validate_search_ids_with_ids_no_override(
32353235
errors: Errors,
32363236
r_session: Session,
32373237
) -> None:
3238-
bbox = item["bbox"]
3238+
bbox = item.get("bbox")
32393239
get_params = {
32403240
"ids": item["id"],
32413241
"collections": item["collection"],
3242-
"bbox": f"{bbox[2] + 1},{bbox[3] + 1},{bbox[2] + 2},{bbox[3] + 2}",
32433242
}
3243+
if bbox is not None:
3244+
get_params["bbox"] = f"{bbox[2] + 1},{bbox[3] + 1},{bbox[2] + 2},{bbox[3] + 2}"
32443245

32453246
if Method.GET in methods:
32463247
_, body, _ = retrieve(
@@ -3263,8 +3264,9 @@ def _validate_search_ids_with_ids_no_override(
32633264
post_params = {
32643265
"ids": [item["id"]],
32653266
"collections": [item["collection"]],
3266-
"bbox": [bbox[2] + 1, bbox[3] + 1, bbox[2] + 2, bbox[3] + 2],
32673267
}
3268+
if bbox is not None:
3269+
post_params["bbox"] = [bbox[2] + 1, bbox[3] + 1, bbox[2] + 2, bbox[3] + 2],
32683270

32693271
_, body, _ = retrieve(
32703272
Method.POST,

0 commit comments

Comments
 (0)