Skip to content

Commit 4792992

Browse files
committed
fix suffix validation for zenodo urls
1 parent 57f5158 commit 4792992

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

bioimageio/spec/_internal/types/field_validation.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,11 @@ def validate_suffix(value: V_suffix, *suffixes: str, case_sensitive: bool) -> V_
142142
if isinstance(value, AnyUrl):
143143
if value.path is None or "." not in value.path:
144144
suffix = ""
145+
elif value.host == "zenodo.org" and value.path.startswith("/api/records/") and value.path.endswith("/content"):
146+
suffix = "." + value.path[: -len("/content")].split(".")[-1]
145147
else:
146148
suffix = "." + value.path.split(".")[-1]
149+
147150
elif isinstance(value, PurePath):
148151
suffix = value.suffixes[-1]
149152
else:

0 commit comments

Comments
 (0)