You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched (google, github) for similar issues and couldn't find anything
I have read and followed the docs and still think this is a bug
Bug
When trying to generate a schema for a model with an optional NamedTuple field which have a default value, schema_json() fails when trying to unpack parameters for the tuple:
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "pydantic/main.py", line 715, in pydantic.main.BaseModel.schema_json
File "pydantic/main.py", line 704, in pydantic.main.BaseModel.schema
File "pydantic/schema.py", line 167, in pydantic.schema.model_schema
File "pydantic/schema.py", line 548, in pydantic.schema.model_process_schema
File "pydantic/schema.py", line 589, in pydantic.schema.model_type_schema
File "pydantic/schema.py", line 234, in pydantic.schema.field_schema
File "pydantic/schema.py", line 202, in pydantic.schema.get_field_info_schema
File "pydantic/schema.py", line 892, in genexpr
TypeError: <lambda>() missing 1 required positional argument: 'y'
Checks
Bug
When trying to generate a schema for a model with an optional
NamedTuple
field which have a default value,schema_json()
fails when trying to unpack parameters for the tuple:Output of
python -c "import pydantic.utils; print(pydantic.utils.version_info())"
:The text was updated successfully, but these errors were encountered: