Skip to content

Releases: pydantic/pydantic

v2.12.5 2025-11-26

26 Nov 15:01

Choose a tag to compare

v2.12.5 (2025-11-26)

This is the fifth 2.12 patch release, addressing an issue with the MISSING sentinel and providing several documentation improvements.

The next 2.13 minor release will be published in a couple weeks, and will include a new polymorphic serialization feature addressing
the remaining unexpected changes to the serialize as any behavior.

  • Fix pickle error when using model_construct() on a model with MISSING as a default value by @ornariece in #12522.
  • Several updates to the documentation by @Viicos.

Full Changelog: v2.12.4...v2.12.5

v2.12.4 2025-11-05

05 Nov 10:49

Choose a tag to compare

v2.12.4 (2025-11-05)

This is the fourth 2.12 patch release, fixing more regressions, and reverting a change in the build() method
of the AnyUrl and Dsn types.

This patch release also fixes an issue with the serialization of IP address types, when serialize_as_any is used. The next patch release
will try to address the remaining issues with serialize as any behavior by introducing a new polymorphic serialization feature, that
should be used in most cases in place of serialize as any.

  • Fix issue with forward references in parent TypedDict classes by @Viicos in #12427.

    This issue is only relevant on Python 3.14 and greater.

  • Exclude fields with exclude_if from JSON Schema required fields by @Viicos in #12430

  • Revert URL percent-encoding of credentials in the build() method of the AnyUrl and Dsn types by @davidhewitt in pydantic-core#1833.

    This was initially considered as a bugfix, but caused regressions and as such was fully reverted. The next release will include
    an opt-in option to percent-encode components of the URL.

  • Add type inference for IP address types by @davidhewitt in pydantic-core#1868.

    The 2.12 changes to the serialize_as_any behavior made it so that IP address types could not properly serialize to JSON.

  • Avoid getting default values from defaultdict by @davidhewitt in pydantic-core#1853.

    This fixes a subtle regression in the validation behavior of the collections.defaultdict
    type.

  • Fix issue with field serializers on nested typed dictionaries by @davidhewitt in pydantic-core#1879.

  • Add more pydantic-core builds for the three-threaded version of Python 3.14 by @davidhewitt in pydantic-core#1864.

Full Changelog: v2.12.3...v2.12.4

v2.12.3 2025-10-17

17 Oct 15:03

Choose a tag to compare

v2.12.3 (2025-10-17)

What's Changed

This is the third 2.13 patch release, fixing issues related to the FieldInfo class, and reverting a change to the supported after model validator function signatures.

  • Raise a warning when an invalid after model validator function signature is raised by @Viicos in #12414.
    Starting in 2.12.0, using class methods for after model validators raised an error, but the error wasn't raised concistently. We decided to emit a deprecation warning instead.
  • Add FieldInfo.asdict() method, improve documentation around FieldInfo by @Viicos in #12411.
    This also adds back support for mutations on FieldInfo classes, that are reused as Annotated metadata. However, note that this is still not a supported pattern. Instead, please refer to the added example in the documentation.

The blog post section on changes was also updated to document the changes related to serialize_as_any.

Full Changelog: v2.12.2...v2.12.3

v2.12.2 2025-10-14

14 Oct 15:02

Choose a tag to compare

v2.12.2 (2025-10-14)

What's Changed

Fixes

  • Release a new pydantic-core version, as a corrupted CPython 3.10 manylinux2014_aarch64 wheel got uploaded (pydantic-core#1843).
  • Fix issue with recursive generic models with a parent model class by @Viicos in #12398

Full Changelog: v2.12.1...v2.12.2

v2.12.1 2025-10-13

13 Oct 21:00

Choose a tag to compare

v2.12.1 (2025-10-13)

GitHub release

What's Changed

This is the first 2.12 patch release, addressing most (but not all yet) regressions from the initial 2.12.0 release.

Fixes

New Contributors

Full Changelog: v2.12.0...v2.12.1

v2.12.0 2025-10-07

07 Oct 15:57
a7928e6

Choose a tag to compare

v2.12.0 (2025-10-07)

Note

Check out the blog post for release highlights. Several minor changes (considered non-breaking changes according to our versioning policy) are also included in this release. Make sure to look into them before upgrading.

Warning

The core functionality of Pydantic V1 is not compatible with Python 3.14 or greater.

This is the final 2.12 release. It features the work of 20 external contributors and provides useful new features, along with initial Python 3.14 support.

Changelog (see the 2.12.0a1 and 2.12.0b1 releases for additional changes since 2.11):

Packaging

New Features

  • Add extra parameter to the validate functions by @anvilpete in #12233
  • Add exclude_computed_fields serialization option by @Viicos in #12334
  • Add preverse_empty_path URL options by @Viicos in #12336
  • Add union_format parameter to JSON Schema generation by @Viicos in #12147
  • Add __qualname__ parameter for create_model by @Atry in #12001

Fixes

  • Do not try to infer name from lambda definitions in pipelines API by @Viicos in #12289
  • Use proper namespace for functions in TypeAdapter by @Viicos in #12324
  • Use Any for context type annotation in TypeAdapter by @inducer in #12279
  • Expose FieldInfo in pydantic.fields.__all__ by @Viicos in #12339
  • Respect validation_alias in @validate_call by @Viicos in #12340
  • Use Any as context annotation in plugin API by @Viicos in #12341
  • Use proper stacklevel in warnings when possible by @Viicos in #12342

New Contributors

Full Changelog: v2.11.10...v2.12.0

v2.12.0b1 2025-10-03

02 Oct 22:07
6dc5d3f

Choose a tag to compare

v2.12.0b1 2025-10-03 Pre-release
Pre-release

v2.12.0b1 (2025-10-03)

This is the first beta release of the upcoming 2.12 release.

What's Changed

Packaging

New Features

Changes

  • Raise error if an incompatible pydantic-core version is installed by @Viicos in #12196
  • Remove runtime warning for experimental features by @Viicos in #12265
  • Warn if registering virtual subclasses on Pydantic models by @Viicos in #11669

Fixes

  • Fix __getattr__() behavior on Pydantic models when a property raised an AttributeError and extra values are present by @raspuchin in #12106
  • Add test to prevent regression with Pydantic models used as annotated metadata by @Viicos in #12133
  • Allow to use property setters on Pydantic dataclasses with validate_assignment set by @Viicos in #12173
  • Fix mypy v2 plugin for upcoming mypy release by @cdce8p in #12209
  • Respect custom title in functions JSON Schema by @Viicos in #11892
  • Fix ImportString JSON serialization for objects with a name attribute by @chr1sj0nes in #12219
  • Do not error on fields overridden by methods in the mypy plugin by @Viicos in #12290

New Contributors

v1.10.24 2025-09-25

25 Sep 01:36
ebb3e81

Choose a tag to compare

What's Changed

  • Add user warning when using Python 3.14 by @Viicos in #12263
    Pydantic V1 will not work with Python 3.14 and greater. A warning is now raised as no actual
    error show up when using it, but the core behavior will silently get broken at runtime.
  • Fix mypy plugin issue for mypy v1.18 by @cdce8p in #12254
    This fixes another mypy issue that was discovered after the previous v1.10.23 release.

Full Changelog: v1.10.23...v1.10.24

v2.11.9 2025-09-13

13 Sep 10:52

Choose a tag to compare

What's Changed

Fixes

  • Backport v1.10.23 changes by @Viicos

Full Changelog: v2.11.8...v2.11.9

v2.11.8 2025-09-13

13 Sep 01:38

Choose a tag to compare

v2.11.8 (2025-09-13)

What's Changed

Fixes

Full Changelog: v2.11.7...v2.11.8