Skip to content

Commit e84cd11

Browse files
committed
remove suffix validation
1 parent bfae019 commit e84cd11

File tree

3 files changed

+6
-26
lines changed

3 files changed

+6
-26
lines changed

bioimageio/spec/model/v0_3/schema.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -512,14 +512,7 @@ class Meta:
512512
documentation = fields.Union(
513513
[
514514
fields.URL(),
515-
fields.Path(
516-
validate=field_validators.Attribute(
517-
"suffix",
518-
field_validators.Equal(
519-
".md", error="{!r} is invalid; expected markdown file with '.md' extension."
520-
),
521-
)
522-
),
515+
fields.Path(),
523516
],
524517
required=True,
525518
bioimageio_description="Relative path to file with additional documentation in markdown. This means: 1) only "

bioimageio/spec/model/v0_4/schema.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -382,14 +382,7 @@ def warn_on_missing_cite(self, data: dict, **kwargs):
382382
documentation = fields.Union(
383383
[
384384
fields.URL(),
385-
fields.Path(
386-
validate=field_validators.Attribute(
387-
"suffix",
388-
field_validators.Equal(
389-
".md", error="{!r} is invalid; expected markdown file with '.md' extension."
390-
),
391-
)
392-
),
385+
fields.Path(),
393386
],
394387
required=True,
395388
bioimageio_description="Relative path or URL to file with additional documentation in markdown. "

bioimageio/spec/shared/fields.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
"""fields to be used in the versioned schemas (may return shared raw nodes on `deserialize`"""
22
import datetime
3-
import packaging.version
43
import logging
54
import pathlib
65
import typing
76

87
import marshmallow_union
98
import numpy
10-
from marshmallow import Schema, ValidationError, fields as marshmallow_fields, missing
9+
import packaging.version
10+
from marshmallow import Schema, ValidationError, missing
11+
from marshmallow import fields as marshmallow_fields
1112

1213
from . import field_validators, raw_nodes
1314
from .utils._docs import resolve_bioimageio_descrcription
@@ -361,14 +362,7 @@ def _deserialize(self, *args, **kwargs) -> typing.Any:
361362
source_file_field = Union(
362363
[
363364
URL(),
364-
Path(
365-
validate=field_validators.Attribute(
366-
"suffix",
367-
field_validators.Equal(
368-
".py", error="{!r} is invalid; expected python source file with '.py' extension."
369-
),
370-
)
371-
),
365+
Path(),
372366
]
373367
)
374368
return raw_nodes.ImportableSourceFile(

0 commit comments

Comments
 (0)