Caching of models for dataclass sub types apparently ignores Config.alias_generator #4793
Closed
6 of 15 tasks
Labels
Milestone
Initial Checks
Description
With classes derived from
BaseModel
which containdataclass
types as members, the schemas for those dataclasses depend on the order in which theBaseModel
classes are declared. Normally this is not an issue, but if you have aBaseModel
class whoseConfig
uses a customalias_generator
, this becomes an issue.The first-declared
BaseModel
class will dictate the cached schema of the containeddataclass
types.Example Code
Python, Pydantic & OS Version
Affected Components
.dict()
and.json()
construct()
, pickling, private attributes, ORM modeThe text was updated successfully, but these errors were encountered: