Skip to content

pleroma.contrib.pydantic

Pydantic v2 integration. Requires pydantic>=2.0 to be installed.

pleroma.contrib.pydantic.MergeableModel

Bases: MergeableMixin, BaseModel

Pydantic v2 base class with merge capabilities.

Subclass this to get a frozen pydantic model that supports the same merge and merged_with interface as :class:~pleroma.MergeableMixin. The model is frozen by default; field mutation after construction raises a pydantic.ValidationError.