Skip to content

Pydantic 2.12 breaks JSON serialization #1346

@mattwthompson

Description

@mattwthompson

Description

Pydantic broke JSON serialization of custom types (pydantic/pydantic#12348 (comment)) in release 2.12 (pydantic/pydantic#12348). Don't know if there plans to be a backwards-compatible fix.

Still investigating.

Reproduction

See logs such as here

The error commonly looks like

pydantic_core._pydantic_core.PydanticSerializationError: Unable to serialize unknown type: <class 'pint.Quantity'>

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions