Pydantic and subclasses
You need to decide whether to inherit from pydantic.BaseModel
, or whether to use the @dataclass
decorator (either from dataclasses
, or from pydantic.dataclasses
).
Either is fine, but you cannot use both, according to the documentation (bold face added by myself):
If you don't want to use pydantic's BaseModel you can instead get the same data validation on standard dataclasses