Repository navigation
Releases
v2.14.3 2026-11-04
v2.14.3 (2026-11-04)
What's Changed
Packaging
-
Build wheels for GraalPy 3.13 by @msimacek in #14136.
The previous v2.14.2 release published GraalPy 3.11 wheels, which were not working due to a PyO3 version bump. A CI workflow issue made it so that the wheel wasn't tested before publishing. This is now fixed: starting in v2.14.3, we no longer publish GraalPy 3.11 wheels, and GraalPy 3.13 wheels are now published together with the existing 3.12 one.
Performance
- Improve schema generation for fixed type handlers by @alexmojaki in #14130
- Skip general schema dispatch for builtin scalars by @alexmojaki in #14141
- Skip annotation handler setup when annotations are empty by @alexmojaki in #14149
- Fix quadratic serialization time with per-index
include/excludeon sequences by @Viicos in #14160 - Avoid type lookups when checking for
Noneduring serialization by @Viicos in #14167 - Improve performance of model serialization by @Viicos in #14171
- Improve performance of dict serialization by @Viicos in #14172
- Improve performance of type inference during serialization by @Viicos in #14173
- Avoid cloning the field name when using the default value during validation by @Viicos in #14175
- Do not evaluate
model_configannotations by @Viicos in #14195 - Avoid slow runtime
Protocolcheck when expandingGroupedMetadataannotations by @Viicos in #14196 - Use a lightweight
@contextmanagerimplementation internally by @Viicos in #14199
Fixes
- Fix various issues about GC tracking in
pydantic-coreby @Viicos in #13819 - Include
nullin serialization JSON Schema forunless-nonefield serializers by @Kropiunig in #13848 - Fix
RecursionErrorwhen copying or unpickling models withdefer_buildby @Viicos in #14115 - Remove dead
default_factorycheck in unsupportedField()attribute by @owtaylor in #14129 - Disallow non string extra keys during validation by @Viicos in #14135
- Fix deeply nested data being reported as a cyclic reference by @Viicos in #14164
New Contributors
v2.14.2 2026-10-29
v2.14.2 (2026-10-29)
This release addresses 2 security issues, GHSA-qpmf-fgh3-ff25 and GHSA-3r8g-cqwr-jr29.
Packaging
- Bump PyO3 to 0.30.1, jiter to 0.18.0, use
PyFrozenDictby @Viicos in #14003 - Bump speedate to v0.18.0 by @Viicos in #14007
- Publish
pydantic-corewheels for PyPy 8.0 (pp80ABI) by @Viicos in #14083
Performance
- Avoid Python tuple allocation during model fields validation by @Viicos in #13955
- Lazily call repr of values during nested union serialization by @Viicos in #14082
- Skip decorator field checks when no field decorators exist by @alexmojaki in #14111
- Avoid heap allocation for small JSON model field buffers by @alexmojaki in #14113
Fixes
-
Make JSON validation by iteration consistent with Python approach by @davidhewitt in #13275.
JSON validation now handles field lookup and extra data the same way as Python validation. In particular, keys that only match an
unused alias or field name are now treated as extra data, instead of being silently dropped:from pydantic import BaseModel, ConfigDict from pydantic.alias_generators import to_camel class Page(BaseModel): model_config = ConfigDict(extra='forbid', alias_generator=to_camel) page_size: int = 10 Page.model_validate_json('{"page_size": 50}') # Before: Page(page_size=10) # After: ValidationError (extra_forbidden)
See the pull request for the full list of behavior changes.
This change addresses GHSA-qpmf-fgh3-ff25. -
Ignore extra data matching a field name in
TypedDictand dataclasses withextra=allowby @Viicos in #14090. Addresses GHSA-3r8g-cqwr-jr29. -
Fix unpickling of generic classes defined in separate module by @Viicos in #13994
-
Support explicit
by_aliasoverridingvalidate_by_aliasin validation JSON schemas by @Viicos in #13997 -
Fix mypy plugin crash on deferred empty model by @ilevkivskyi in #14027
-
Fix infinite recursion when validating an invalid default with
PydanticUseDefaultby @Viicos in #14028 -
Implement recursion guard for
validate_strings()by @Viicos in #14029 -
Support named tuples in
Sequenceserialization by @Viicos in #14033 -
Take
preserve_empty_pathinto account in URL types equality by @Viicos in #14035 -
Fix pickling of
PydanticCustomErrorandValidationErrors containing custom errors by @Viicos in #14051 -
Do not extract attribute docstrings from nested classes and functions by @Viicos in #14052
-
Fix forward annotations evaluation and type variables substitution when rebuilding parametrized generic models by @Viicos in #14054
-
Fix
Selfresolution in parametrized generics by @Viicos in #14065 -
Check mapping
max_lengthconstraint during validation by @Viicos in #14092 -
Fix deep copy of self-referential models by @Viicos in #14116
Full Changelog: v2.14.1...v2.14.2
v1.10.27 2026-10-29
v1.10.27 (2026-10-29)
This is the last V1 Pydantic release. V1 support (including the pydantic.v1 namespace in Pydantic V2) fully ends after this release.
This release contains three security fixes, that were also included in the pydantic.v1 namespace of the v2.14.2 release.
-
Check
unique_itemsin linear time for builtin scalar types by @Viicos in #14101. Addresses GHSA-49g6-96jj-f7r9. -
Ignore internal
__pydanticattributes when setting extra values on dataclasses by @Viicos in #14103. Addresses GHSA-r49w-vh47-r4hf. -
Only accept
.as the decimal separator in ISO 8601 durations by @Viicos in #14096. Addresses GHSA-jfv7-ghgv-gx4x.
Full Changelog: v1.10.26...v1.10.27
v2.14.1 2026-10-11
What's Changed
Performance
- Avoid Python tuple allocation during model fields validation by @Viicos in #13955
- Avoid unnecessary extra dict allocation in model validation by @Viicos in #13956
Fixes
- Fix
arguments-v3schema with variadic keywords by @Viicos in #13954 - Fix
TypeErroronForwardRefon Python 3.10.0 by @Viicos in #13964 - Support
closedandextra_itemsvia inheritance inTypedDictby @Viicos in #13967 - Enforce the
max_digitswhole-digits limit in the PythonDecimalvalidator by @Viicos in #13972 - Reject out-of-range int inputs for
timedeltaby @Viicos in #13973 - Support named tuples in
Sequencevalidation by @Viicos in #13978
Full Changelog: v2.14.0...v2.14.1
v2.14.0 2026-10-08
What's Changed
The highlights of the v2.14 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 drops support for Python 3.9 and adds support for Python 3.15.
Two security fixes are fixed by this release: GHSA-gj4f-r7mf-jjxh and GHSA-955g-x97g-8mcp.
New Features
- Add support for
multiple_ofconstraint infractionandtimedeltacore schemas by @Viicos in #13873 - Add
__namespace__parameter tocreate_model()by @Viicos in #13895
Changes
- Add an
ordered-dictcore schema by @Viicos in #13796 - Add a
countercore schema by @Viicos in #13824 - Do not mutate
model_configattribute by @Viicos in #13825 - Reject newlines in
NameEmailvalidation by @Viicos in #13897
Fixes
- Reject large exponents in
Fractionvalidation by @Viicos in #13944. Addresses GHSA-gj4f-r7mf-jjxh. - Avoid validating URL prefix multiple times in multi host URLs by @Viicos in #13945. Addresses GHSA-955g-x97g-8mcp.
- Call enum constructors in both validation modes by @Viicos in #13792
- Fix documentation examples not raising and remove unused
string_sub_typeunused error code by @Viicos in #13821 - Catch
OverflowErrorduringByteSizevalidation by @Viicos in #13850 - Require
multiple_ofconstraints to be positive by @Viicos in #13862 - Always pop field name and model type stacks during schema generation by @saquibjawedbit in #13859
- Handle
TypeErrorgracefully during docstring extraction by @Viicos in #13874 - Fix config propagation of stdlib dataclasses and
TypedDicts in JSON Schema by @Viicos in #13891 - Don't apply
ser_json_timedeltato all datetime types in serialization inference by @Viicos in #13892 - Encode JSON Schema defaults with a consistent configuration by @Viicos in #13893
- Propagate
initandkw_only=FalsefromField()to stdlib dataclass fields by @Viicos in #13898 - Respect propagated extra config in the JSON Schema of stdlib dataclasses by @Viicos in #13899
- Handle OS errors during
ZoneInfovalidation by @Viicos in #13912 - Handle exceptions during
Decimalvalidation by @Viicos in #13940 - Rebuild incomplete types during serialization inference by @Viicos in #13922
Full Changelog: v2.13.0...v2.14.0
v2.14.0b2 2026-09-09
What's Changed
This pre-release adds full support for Python 3.15 specific features, such as support for frozendict, making use of TypeForm and stabilizing the MISSING sentinel type.
New Features
-
Allow any
CoreSchemato be used as serialization by @Viicos in #13680 -
Add support for
frozendicttype by @Viicos in #13634 -
Allow
dict,frozendictandfrozensetasdefaultdictdefault factories by @Viicos in #13623 -
Add support for
TypeFormby @Viicos in #13459.This adds support for static type checking where a type form is expected. For instance, type adapters:
from pydantic import TypeAdapter ta = TypeAdapter(int | str) assert_type(ta.validate_python(1), int | str)
-
Stabilize
MISSINGsentinel by @Viicos in #13782.The
MISSINGsentinel is no longer experimental, and can be imported asfrom pydantic import MISSING.
Changes
- Take
ser_json_temporalinto account when generating JSON Schema by @shashiKundur1 in #13665 - Use the field name in
__signature__whenvalidate_by_aliasisFalseby @jaideeppyne in #13730 - Add a
dequecore schema by @Viicos in #13757 - Do not mention
MISSINGas a valid value in validation errors by @Viicos in #13779 - Refactor
DecimalJSON Schemapatternconstraint by @Viicos in #13672
Performance
- Refactor type references logic by @Viicos in #13643
- Improve performance of
GenerateSchema.generate_schema()dispatching by @Viicos in #13614 - Move schema gathering logic to
pydantic-coreby @Viicos in #13725 - Improve performance of
FieldInfoconstruction by @Viicos in #13726
Fixes
- Fix support for callable discriminators with PEP 695 type aliases by @Viicos in #13604
- Preserve
re.Patterninstance for compiled patterns in the experimental pipeline by @soma0212 in #13611 - Fix missing GC traversal on some
pydantic-corestruct fields by @Viicos in #13624 - Fix missing GC traversal in
pydantic-coreforGeneralFieldsSerializerby @Viicos in #13629 - Fix JSON schema discriminator mapping keys for
booldiscriminators by @remi-fongaufier in #13632 - Fix application of other constraints in the pipeline API by @Viicos in #13659
- Support bare
Noneannotation for discriminated unions by @Viicos in #13667 - Respect runtime alias validation configuration when wrap validators are present by @Viicos in #13668
- Exclude computed fields with
exclude_iffrom JSON Schema required fields by @Bishwas-py in #13563 - Use config of
TypeAdapterin JSON Schema generation by @Viicos in #13676 - Support
populate_by_namein@validate_callby @Viicos in #13691 - Allow
Noneto serialize against secret fields by @Viicos in #13699 - Do not drop include/exclude if serializer wasn't called by @Viicos in #13702
- Don't apply serialization temporal formats to validation JSON schemas by @MLuc24 in #13711
- Reflect
str_min_lengthandstr_max_lengthconfig in the JSON schema by @MLuc24 in #13714 - Treat a class attribute set to
Noneas existing when assigning withextra='allow'by @Kropiunig in #13718 - Use the field name in validation JSON schemas when
validate_by_aliasisFalseby @MLuc24 in #13717 - Do not rely on normalization to validate decimals by @Viicos in #13742
- Handle any exception when trying to compute JSON Schema default by @Viicos in #13741
- Fix Mypy plugin crash with import cycle by @Viicos in #13767
- Fix supported constraints for types of
datetimemodule by @Viicos in #13768 - Fix inconsistencies between constraints and core schemas allowed values by @Viicos in #13772
- Allow
selfto be used as a parameter with@validate_callby @Viicos in #13773 - Fix race conditions in freethreaded build by @Viicos in #13785
New Contributors
- @soma0212 made their first contribution in #13611
- @remi-fongaufier made their first contribution in #13632
- @shashiKundur1 made their first contribution in #13665
- @MLuc24 made their first contribution in #13711
- @jaideeppyne made their first contribution in #13730
Full Changelog: v2.14.0a1...v2.14.0b2
v2.13.5 2026-08-28
v2.13.5 (2026-08-28)
What's Changed
Fixes
- Allow reuse of validators when plugins are set by @Viicos in #13535
- Fix missing GC traversal on some
pydantic-corestruct fields by @Viicos in #13624 - Fix missing GC traversal in
pydantic-coreforGeneralFieldsSerializerby @Viicos in #13629 - Count validated model fields once in smart unions by @tamird in #13731
v2.14.0b1 2026-08-06
What's Changed
This is the first beta release of the 2.14 version, providing some new features and performance improvements for model builds.
This release is the first to provide initial support for Python 3.15, although not all 3.15 specific features are supported yet.
Packaging
New Features
- Add support for
EllipsisTypeby @Viicos in #13484 - Add initial support for Python 3.15 by @Viicos in #13587
Changes
- Populate
__slots__from generic class during parameterization by @Viicos in #13243 - Avoid using explicit
Anyin the Mypy plugin by @Viicos in #13196 - Support
Fractiontype inpydantic-coreby @Viicos in #13339 - Use constant-time comparison for
SecretStrandSecretBytestypes by @Viicos in #13518 - Fix application of constraints in pipeline API by @Viicos in #13516
- Optimize type lookup logic in core schema generation by @Viicos in #13573
- Add a
named-tuplecore schema by @Viicos in #13505 - Raise explicit
TypeErroron invalidindex_keyserialization wrap handler by @Viicos in #13506
Performance
- Cache
ModelPrivateAttr.default_factory_takes_validated_dataproperty by @Viicos in #13390 - Introduce micro-optimizations for model class building by @dmontagu in #13540
- Try
Format.VALUEbeforeFORWARDREFwhen evaluating annotations inModelMetaclassby @Viicos in #13584 - Optimize type lookup logic in core schema generation by @Viicos in #13573
- Avoid exponential core schema traversal in
gather_schemas_for_cleaning()by @dmontagu in #13523
Fixes
- Validate falsy
AliasGeneratoroutputs by @jiyujie2006 in #13248 - Do not resolve recursive
'definitions-ref'schemas in schema cleaning by @Viicos in #13276 - Fix missing
max_lengthcheck on lazy iteration validation by @davidhewitt in #13278 - Handle missing errors with default factories taking validated data by @Viicos in #13291
- Recognise
WindowsPathas a schema type by @davidhewitt in #13326 - Fix application of nested operators in pipeline API by @Viicos in #13363
- Fix type variable substitution in
__pydantic_extra__by @Viicos in #13391 - Fix
json_schema_extradict being dropped when a callable follows it inAnnotatedby @Srivatsa03 in #13374 - Skip
RootModel.__init__()in Mypy plugin by @Viicos in #13441 - Defer placeholders in Mypy plugin by @Viicos in #13442
- Do not ignore timezone offset when using
'seconds'/'milliseconds'temporal_modeby @Viicos in #13436 - Make model rebuilding logic thread safe by @Viicos in #13438
- Fix
Intervalzero bounds silently dropped in pipeline API by @pctablet505 in #13452 - Sync
RootModel.model_dump()signature with its parent by @Viicos in #13456 - Return
NotImplementedfrom URL ordering comparisons with foreign types by @chinesepowered in #13495 - Don't error on unhashable generic arguments on generic Pydantic models by @Viicos in #13515
- Fix population of
SerializationInfo.exclude_computed_fieldsby @Viicos in #13560 - Fix serialization of
ValidateAsby @Viicos in #13487 - Allow reuse of validators when plugins are set by @Viicos in #13535
- Avoid double-wrapping polymorphism trampoline for model serializers by @davidhewitt in #13552
- Add
AllowInfNantype to the field metadata gathering by @mberdyshev in #13586
New Contributors
- @jiyujie2006 made their first contribution in #13248
- @pctablet505 made their first contribution in #13452
- @LuShadowX made their first contribution in #13503
- @mberdyshev made their first contribution in #13586
Full Changelog: v2.14.0a1...v2.14.0b1
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