Skip to content

Releases

v2.14.3 2026-11-04

Choose a tag to compare

@Viicos Viicos released this 05 Nov 09:18

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/exclude on sequences by @Viicos in #14160
  • Avoid type lookups when checking for None during 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_config annotations by @Viicos in #14195
  • Avoid slow runtime Protocol check when expanding GroupedMetadata annotations by @Viicos in #14196
  • Use a lightweight @contextmanager implementation internally by @Viicos in #14199

Fixes

  • Fix various issues about GC tracking in pydantic-core by @Viicos in #13819
  • Include null in serialization JSON Schema for unless-none field serializers by @Kropiunig in #13848
  • Fix RecursionError when copying or unpickling models with defer_build by @Viicos in #14115
  • Remove dead default_factory check in unsupported Field() 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

Choose a tag to compare

@Viicos Viicos released this 29 Oct 16:40

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 PyFrozenDict by @Viicos in #14003
  • Bump speedate to v0.18.0 by @Viicos in #14007
  • Publish pydantic-core wheels for PyPy 8.0 (pp80 ABI) 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 TypedDict and dataclasses with extra=allow by @Viicos in #14090. Addresses GHSA-3r8g-cqwr-jr29.

  • Fix unpickling of generic classes defined in separate module by @Viicos in #13994

  • Support explicit by_alias overriding validate_by_alias in 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 PydanticUseDefault by @Viicos in #14028

  • Implement recursion guard for validate_strings() by @Viicos in #14029

  • Support named tuples in Sequence serialization by @Viicos in #14033

  • Take preserve_empty_path into account in URL types equality by @Viicos in #14035

  • Fix pickling of PydanticCustomError and ValidationErrors 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 Self resolution in parametrized generics by @Viicos in #14065

  • Check mapping max_length constraint 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

Choose a tag to compare

@Viicos Viicos released this 29 Oct 15:58
63bb6f4

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.

Full Changelog: v1.10.26...v1.10.27

v2.14.1 2026-10-11

Choose a tag to compare

@Viicos Viicos released this 11 Oct 18:39

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-v3 schema with variadic keywords by @Viicos in #13954
  • Fix TypeError on ForwardRef on Python 3.10.0 by @Viicos in #13964
  • Support closed and extra_items via inheritance in TypedDict by @Viicos in #13967
  • Enforce the max_digits whole-digits limit in the Python Decimal validator by @Viicos in #13972
  • Reject out-of-range int inputs for timedelta by @Viicos in #13973
  • Support named tuples in Sequence validation by @Viicos in #13978

Full Changelog: v2.14.0...v2.14.1

v2.14.0 2026-10-08

Choose a tag to compare

@Viicos Viicos released this 08 Oct 16:12
fcdefa7

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_of constraint in fraction and timedelta core schemas by @Viicos in #13873
  • Add __namespace__ parameter to create_model() by @Viicos in #13895

Changes

Fixes

  • Reject large exponents in Fraction validation 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_type unused error code by @Viicos in #13821
  • Catch OverflowError during ByteSize validation by @Viicos in #13850
  • Require multiple_of constraints to be positive by @Viicos in #13862
  • Always pop field name and model type stacks during schema generation by @saquibjawedbit in #13859
  • Handle TypeError gracefully 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_timedelta to all datetime types in serialization inference by @Viicos in #13892
  • Encode JSON Schema defaults with a consistent configuration by @Viicos in #13893
  • Propagate init and kw_only=False from Field() 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 ZoneInfo validation by @Viicos in #13912
  • Handle exceptions during Decimal validation 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

v2.14.0b2 2026-09-09 Pre-release
Pre-release

Choose a tag to compare

@Viicos Viicos released this 08 Oct 14:38
6312eb1

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 CoreSchema to be used as serialization by @Viicos in #13680

  • Add support for frozendict type by @Viicos in #13634

  • Allow dict, frozendict and frozenset as defaultdict default factories by @Viicos in #13623

  • Add support for TypeForm by @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)
  • Add support for lazy imports by @Viicos in #13776

  • Stabilize MISSING sentinel by @Viicos in #13782.

    The MISSING sentinel is no longer experimental, and can be imported as from pydantic import MISSING.

Changes

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-core by @Viicos in #13725
  • Improve performance of FieldInfo construction by @Viicos in #13726

Fixes

  • Fix support for callable discriminators with PEP 695 type aliases by @Viicos in #13604
  • Preserve re.Pattern instance for compiled patterns in the experimental pipeline by @soma0212 in #13611
  • Fix missing GC traversal on some pydantic-core struct fields by @Viicos in #13624
  • Fix missing GC traversal in pydantic-core for GeneralFieldsSerializer by @Viicos in #13629
  • Fix JSON schema discriminator mapping keys for bool discriminators by @remi-fongaufier in #13632
  • Fix application of other constraints in the pipeline API by @Viicos in #13659
  • Support bare None annotation 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_if from JSON Schema required fields by @Bishwas-py in #13563
  • Use config of TypeAdapter in JSON Schema generation by @Viicos in #13676
  • Support populate_by_name in @validate_call by @Viicos in #13691
  • Allow None to 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_length and str_max_length config in the JSON schema by @MLuc24 in #13714
  • Treat a class attribute set to None as existing when assigning with extra='allow' by @Kropiunig in #13718
  • Use the field name in validation JSON schemas when validate_by_alias is False by @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 datetime module by @Viicos in #13768
  • Fix inconsistencies between constraints and core schemas allowed values by @Viicos in #13772
  • Allow self to be used as a parameter with @validate_call by @Viicos in #13773
  • Fix race conditions in freethreaded build by @Viicos in #13785

New Contributors

Full Changelog: v2.14.0a1...v2.14.0b2

v2.13.5 2026-08-28

Choose a tag to compare

@Viicos Viicos released this 28 Aug 14:06

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-core struct fields by @Viicos in #13624
  • Fix missing GC traversal in pydantic-core for GeneralFieldsSerializer by @Viicos in #13629
  • Count validated model fields once in smart unions by @tamird in #13731

v2.14.0b1 2026-08-06

v2.14.0b1 2026-08-06 Pre-release
Pre-release

Choose a tag to compare

@Viicos Viicos released this 08 Oct 14:37
5922459

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

Changes

  • Populate __slots__ from generic class during parameterization by @Viicos in #13243
  • Avoid using explicit Any in the Mypy plugin by @Viicos in #13196
  • Support Fraction type in pydantic-core by @Viicos in #13339
  • Use constant-time comparison for SecretStr and SecretBytes types 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-tuple core schema by @Viicos in #13505
  • Raise explicit TypeError on invalid index_key serialization wrap handler by @Viicos in #13506

Performance

  • Cache ModelPrivateAttr.default_factory_takes_validated_data property by @Viicos in #13390
  • Introduce micro-optimizations for model class building by @dmontagu in #13540
  • Try Format.VALUE before FORWARDREF when evaluating annotations in ModelMetaclass by @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 AliasGenerator outputs by @jiyujie2006 in #13248
  • Do not resolve recursive 'definitions-ref' schemas in schema cleaning by @Viicos in #13276
  • Fix missing max_length check on lazy iteration validation by @davidhewitt in #13278
  • Handle missing errors with default factories taking validated data by @Viicos in #13291
  • Recognise WindowsPath as 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_extra dict being dropped when a callable follows it in Annotated by @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_mode by @Viicos in #13436
  • Make model rebuilding logic thread safe by @Viicos in #13438
  • Fix Interval zero bounds silently dropped in pipeline API by @pctablet505 in #13452
  • Sync RootModel.model_dump() signature with its parent by @Viicos in #13456
  • Return NotImplemented from 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_fields by @Viicos in #13560
  • Fix serialization of ValidateAs by @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 AllowInfNan type to the field metadata gathering by @mberdyshev in #13586

New Contributors

Full Changelog: v2.14.0a1...v2.14.0b1

v2.14.0a1 2026-05-22

v2.14.0a1 2026-05-22 Pre-release
Pre-release

Choose a tag to compare

@Viicos Viicos released this 22 May 13:46
86f6bbf

v2.14.0a1 (2026-05-22)

What's Changed

Packaging

Changes

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

Full Changelog: v2.13.4...v2.14.0a1

v2.13.4 2026-05-06

Choose a tag to compare

@Viicos Viicos released this 06 May 13:44

v2.13.4 (2026-05-06)

What's Changed

Packaging

Fixes

Full Changelog: v2.13.3...v2.13.4