-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Open
Labels
bug V2Bug related to Pydantic V2Bug related to Pydantic V2
Description
From https://github.com/pydantic/pydantic-core/pull/1835/files#r2425738743:
from pydantic import BaseModel
class Model(BaseModel, extra='allow'):
a: int
__pydantic_extra__: dict[str, int]
m = Model(a=1, extra=1)
m.a = 'not_an_int'
m.model_dump_json() # PydanticSerializationUnexpectedValue warning raised
m.a = 1
m.extra = 'not_an_int'
m.model_dump_json() # No warning raisedAlso https://github.com/pydantic/pydantic-core/pull/1835/files#r2425737760 should probably be supported.
Metadata
Metadata
Assignees
Labels
bug V2Bug related to Pydantic V2Bug related to Pydantic V2