Skip to content

Commit 08897b2

Browse files
committed
fix: remove incorrect disalow_extra check
It was only used once, and I don't think it's correct.
1 parent b638c21 commit 08897b2

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/stac_api_validator/validations.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2185,7 +2185,6 @@ def validate_exclude_field(
21852185
field: str,
21862186
errors: Errors,
21872187
warnings: Warnings,
2188-
disallow_extra: bool = True,
21892188
):
21902189
if not body or not (item := first_item(body)):
21912190
errors += f"[{context}] : response had no items in response for {desc}"
@@ -2200,10 +2199,6 @@ def validate_exclude_field(
22002199
if value:
22012200
errors += f"[{context}] : {desc} response contained '{field}', but should have been excluded"
22022201

2203-
if disallow_extra:
2204-
if len(item) < 5:
2205-
errors += f"[{context}] : {desc} response contained fewer than 5 fields {list(item.keys())}"
2206-
22072202
if Method.GET in search_method_to_url:
22082203
_, body, _ = retrieve(
22092204
Method.GET,
@@ -2384,7 +2379,7 @@ def validate_post_case(fields: Any, msg: str):
23842379
r_session=r_session,
23852380
)
23862381
desc = f"GET fields='{field}'"
2387-
validate_exclude_field(desc, body, "geometry", errors, warnings, False)
2382+
validate_exclude_field(desc, body, "geometry", errors, warnings)
23882383
validate_include_field(
23892384
desc, body, fields_nested_property, errors, warnings, True
23902385
)

0 commit comments

Comments
 (0)