Change8

Migrating to Pydantic v2.12.0

Version v2.12.0 introduces 1 breaking change. This guide details how to update your code.

Released: 10/7/2025

1
Breaking Changes
5
Migration Steps
8
Affected Symbols

⚠️ Check Your Code

If you use any of these symbols, you need to read this guide:

TypeAdaptercreate_modelFieldInfopydantic.fieldsvalidate_callmodel_validatemodel_dumpGenerateJsonSchema

Breaking Changes

Issue #1

The release notes explicitly mention that several minor changes are included that are considered non-breaking according to the versioning policy, suggesting developers should review the linked blog post for potential subtle behavioral shifts.

Solution

Review the linked blog post for Pydantic v2.12.0 highlights and the full changelog to ensure no minor behavioral changes impact existing logic, especially around validation or serialization.

Migration Steps

  1. 1
    Update your Pydantic dependency to version 2.12.0 or later.
  2. 2
    If you rely on Pydantic V1 compatibility while using Python 3.14+, ensure you have upgraded Pydantic V1 to at least v1.10.26 (though migrating to Pydantic V2 is strongly recommended).
  3. 3
    Review the new features, such as the `extra` parameter in validation functions and `exclude_computed_fields` serialization option, to see if they can improve your existing code.
  4. 4
    If you use `pydantic.create_model`, note that you can now explicitly set `__qualname__` for better introspection.
  5. 5
    If you encounter unexpected behavior related to validation aliases in `@validate_call`, verify that the fix respecting `validation_alias` works as expected in your use case.

Release Summary

Pydantic v2.12.0 introduces initial Python 3.14 support, new serialization options like exclude_computed_fields, and various improvements to TypeAdapter and JSON Schema generation.

Need More Details?

View the full release notes and all changes for Pydantic v2.12.0.

View Full Changelog