Releases: pydantic/pydantic
v2.14.0a1 2026-05-22
v2.14.0a1 (2026-05-22)
What's Changed
Packaging
- Add PyEmscripten platform tag support by @Viicos, @greateggsgreg and @sinaatalay in #13199:
pydantic-corenow has a 3.14 wheel published with thepyemscripten_2026_0platform tag.
Note that this wheel can only be used with Pyodide 314.0 and greater, still in development.
It is recommended to wait for the final 314.0 release (and for Pydantic to publish a new wheel in a future 2.14 release).
Changes
- Accept
NoneinMultiHostUrl.build()'shostsparameter by @Viicos in #13068 - Drop support for Python 3.9 by @Viicos in #13070
- Remove support for
eval_type_backport()by @Viicos in #13133 - Only deepcopy non-updated fields in
model_copy()by @connorcarpenter15 in #13087
Fixes
- Add Mypy plugin workaround for dynamic models defined in functions by @ilevkivskyi in #13177
- Fallback to
create_model()overload definition when__base__is set to a type variable in the Mypy plugin by @cyphercodes in #13146
New Contributors
- @ilevkivskyi made their first contribution in #13177
- @cyphercodes made their first contribution in #13146
- @connorcarpenter15 made their first contribution in #13087
Full Changelog: v2.13.4...v2.14.0a1
v2.13.4 2026-05-06
v2.13.4 (2026-05-06)
What's Changed
Packaging
- Bump libc from 0.2.155 to 0.2.185 by @Viicos in #13109
- Adapt
pydantic-corelinker flags on macOS by @washingtoneg and @Viicos in #13147
Fixes
Full Changelog: v2.13.3...v2.13.4
v2.13.3 2026-04-20
v2.13.2 2026-04-17
v2.13.1 2026-04-15
v2.13.1 (2026-04-15)
What's Changed
Fixes
- Fix
ValidationInfo.datamissing withmodel_validate_json()by @davidhewitt in #13079
Full Changelog: v2.13.0...v2.13.1
v2.13.0 2026-04-13
v2.13.0 (2026-04-13)
The highlights of the v2.13 release are available in the blog post.
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.
This release contains the updated pydantic.v1 namespace, matching version 1.10.26 which includes support for Python 3.14.
What's Changed
See the beta releases for all changes sinces 2.12.
Packaging
- Add zizmor for GitHub Actions workflow linting by @Viicos in #13039
- Update jiter to v0.14.0 to fix a segmentation fault on musl Linux by @Viicos in #13064
New Features
Changes
- Warn when serializing fixed length tuples with too few items by @arvindsaripalli in #13016
Fixes
- Change type of
Anywhen synthesizing_build_sourcesforBaseSettings.__init__()signature in the mypy plugin by @Viicos in #13049 - Fix model equality when using runtime
extraconfiguration by @Viicos in #13062
New Contributors
- @arvindsaripalli made their first contribution in #13016
Full Changelog: v2.12.0...v2.13.0
v2.13.0b3 2026-03-31
What's Changed
Packaging
New Features
- Add
ascii_onlyoption toStringConstraintsby @ai-man-codes in #12907 - Support
exclude_ifin computed fields by @andresliszt in #12748 - Push down constraints in unions involving
MISSINGsentinel by @Viicos in #12908
Changes
- Track extra fields set after init in
model_fields_setby @navalprakhar in #12817 - Do not include annotations that are not part of named tuple fields by @galuszkak in #12951
- No longer fall back to trying all union members when the variant selected by discriminator fails to serialize by @navalprakhar in #12825
Fixes
- Support discriminator metadata outside union type alias by @Viicos in #12785
- Respect
extras_schemawhen onlyextra_fields_behavioris set on the config in JSON Schema generation for typed dictionaries by @Viicos in #12810 - Ensure
__pydantic_private__is set inmodel_construct()with user-definedmodel_post_init()by @nightcityblade in #12816 - Handle all schema generation errors in
InstanceOfby @Viicos in #12705 - Allow dynamic models created with
create_model()to be used as annotations in the Mypy plugin by @Br1an67 in #12879 - Check for
PlaceholderNodein Mypy plugin by @Viicos in #12929 - Try other branches in smart union in case of omit errors by @mikeedjones in #12758
- Patch unset attributes with
MISSINGduring model serialization withexclude_unsetby @davidhewitt in #12905 - Ensure custom
__init__()is called when usingmodel_validate_strings()by @siewcapital in #12897
New Contributors
- @kelsonbrito50 made their first contribution in #12860
- @boosterl made their first contribution in #12723
- @adityagiri3600 made their first contribution in #12868
- @navalprakhar made their first contribution in #12817
- @Br1an67 made their first contribution in #12879
- @rmorshea made their first contribution in #12910
- @N3XT3R1337 made their first contribution in #12922
- @ai-man-codes made their first contribution in #12907
- @Yume05-dev made their first contribution in #12953
- @galuszkak made their first contribution in #12951
- @siewcapital made their first contribution in #12897
Full Changelog: v2.13.0b2...v2.13.0b3
v2.13.0b2 2026-02-24
v2.13.0b1 2026-02-23
This is the first beta release of the 2.13 version, mainly providing bug fixes and performance improvements
for validation and serialization.
Notable changes include:
- Add a new
polymorphic_serializationoption, solving issues withserialize_as_anyintroduced in 2.12. - Latest V1.10.26 release under the
pydantic.v1namespace. This version includes support for Python 3.14. - The
pydantic-corerepository was merged inside the mainpydanticone.
What's Changed
Packaging
- Bump Rust url dependency from 2.5.4 to 2.5.7 in
pydantic-coreby @dependabot[bot] in #12508 - Bump Rust minimum version to 1.88, use edition 2024 by @davidhewitt and @Viicos in #12551 and #12752
- Bump PyO3 to 0.28, jiter to 0.13 by @davidhewitt in #12767
New Features
- Add
polymorphic_serializationoption by @davidhewitt in #12518 - Support Root models with
Literalroot types as discriminator field types by @YassinNouh21 in #12680
Changes
- Migrate
pydantic-coreCI by @Viicos in #12752 - Import
pydantic-coreinto pydantic by @davidhewitt in #12481 - Backport V1 changes up to v1.10.26 by @Viicos in #12663
- Use the
complex()constructor unconditionally when validatingcomplexPython data by @tanmaymunjal in #12498 - Add support for three-tuple input for
Decimalby @tanmaymunjal in #12500 - Align
@field_serializerlogic with@field_validatorby @Viicos in #12577 - Make
PydanticUserErroraRuntimeErrorinstead of aTypeErrorby @poliakovva in #12579 - Remove redundant serialization attempts in nested unions by @davidhewitt in #12604
- Copy
rootvalue when making root model shallow copies by @YassinNouh21 in #12679 - Ensure deterministic JSON schema defaults by sorting sets by @drshvik in #12760
Performance
- Refactor
DecoratorInfos.build()implementation by @Viicos in #12536 - Cache compiled regex in
pydantic-coreby @Viicos in #12549 - Optimize creation of
Literalvalidators by @davidhewitt in #12569 - Optimize implementation of
LookupKeyby @davidhewitt in #12571 - Use python strings for field names by @davidhewitt in #12631
- Optimize datetime formatting code by @davidhewitt in #12626
- Validate JSON model data by iteration by @davidhewitt in #12550
- Optimize annotations evaluation of Pydantic models by @Viicos in #12681
- Optimize
FieldInfo._copy()by @Viicos in #12727
Fixes
- Fix
FieldInforebuilding when parameterizing generic models with anAnnotatedtype by @Viicos in #12463 - Fix nested model schema deduplication in JSON schema generation by @marwan-alloreview in #12494
- Fix
InitVarbeing ignored when using with thepydantic.Field()function by @Viicos in #12495 - Fix support for enums with
NamedTupleas values by @Viicos in #12506 - Do not delete mock validator/serializer in
rebuild_dataclass()by @Viicos in #12513 - Require test suite to pass with free threading, switch back to global generic types cache by @davidhewitt in #12537
- Refactor
__pydantic_extra__annotation handling by @Viicos in #12563 - Do not add claim of UUID "safety" provision by @davidhewitt in #12567
- Use Python hash to perform lookup in tagged union serializer by @davidhewitt in #12594
- Do not emit serialization warning
MISSINGsentinel is present in a nested model by @Viicos in #12635 - Do not eagerly evaluate annotations in signature logic by @Viicos in #12660
- Fix serialization of typed dict unions when
exclude_noneis set by @davidhewitt in #12677 - Do not reuse prebuilt serializers/validators on rebuilds by @lmmx in #12689
- Fix type annotation of
field_definitionsincreate_model()by @lehmann-hqs in #12734 - Fix incorrect dataclass constructor signature when overriding class
kw_onlywithField()by @jfadia in #12741 - Use
typing.Unionwhen replacing types under Python 3.14 by @Viicos in #12733 - Improve ImportString error when internal imports fail by @tsembp in #12740
- Fix serializing complex numbers with negative zero imaginary part by @lhnwrk in #12770
- Preserve custom docstrings on stdlib dataclasses in JSON schema by @nightcityblade in #12815
New Contributors
- @marwan-alloreview made their first contribution in #12494
- @tanmaymunjal made their first contribution in #12498
- @poliakovva made their first contribution in #12579
- @lehmann-hqs made their first contribution in #12734
- @jfadia made their first contribution in #12741
- @tsembp made their first contribution in #12740
- @drshvik made their first contribution in #12760
- @lhnwrk made their first contribution in #12770
- @nightcityblade made their first contribution in #12815
v1.10.26 2025-12-18
What's Changed
Full Changelog: v1.10.25...v1.10.26