Skip to content

Commit e37034c

Browse files
committed
fixes changes in pydantic
1 parent ba77aa4 commit e37034c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

packages/models-library/tests/test__pydantic_models.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
""" This test suite does not intend to re-test pydantic but rather
1+
"""This test suite does not intend to re-test pydantic but rather
22
check some "corner cases" or critical setups with pydantic model such that:
33
44
- we can ensure a given behaviour is preserved through updates
@@ -120,7 +120,7 @@ class Func(BaseModel):
120120
{"$ref": "#/$defs/DatCoreFileLink"},
121121
{"$ref": "#/$defs/DownloadLink"},
122122
{"type": "array", "items": {}},
123-
{"type": "object"},
123+
{"type": "object", "additionalProperties": True},
124124
],
125125
}
126126

@@ -183,7 +183,9 @@ def test_nullable_fields_from_pydantic_v1():
183183
# SEE https://github.com/ITISFoundation/osparc-simcore/pull/6751
184184
class MyModel(BaseModel):
185185
# pydanticv1 would add a default to fields set as nullable
186-
nullable_required: str | None # <--- This was default to =None in pydantic 1 !!!
186+
nullable_required: (
187+
str | None
188+
) # <--- This was default to =None in pydantic 1 !!!
187189
nullable_required_with_hyphen: str | None = Field(default=...)
188190
nullable_optional: str | None = None
189191

0 commit comments

Comments
 (0)