Pydantic v2.14.0

v2.14.0

v2.14.0 2026-10-08

Added 5
Changed 2
Fixed 10
  • Enum constructors are called in both validation modes
  • Documentation examples now raise as expected and the unused string_sub_type error code is removed removed · inferred, marked in the notes below
  • OverflowError is caught during ByteSize validation
  • multiple_of constraints are required to be positive
  • Field name and model type stacks are always popped during schema generation
  • TypeError is handled gracefully during docstring extraction
Security 2
  • Rejects large exponents in Fraction validation to address GHSA-gj4f-r7mf-jjxh
  • Avoids validating URL prefix multiple times in multi host URLs to address GHSA-955g-x97g-8mcp

4 changes to check, marked in the notes below

From Pydantic

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. requirement raised · inferred

Two security fixes are fixed by this release: https://github.com/pydantic/pydantic/security/advisories/GHSA-gj4f-r7mf-jjxh and https://github.com/pydantic/pydantic/security/advisories/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
  • Add an ordered-dict core schema by @Viicos in #13796
  • Add a counter core schema by @Viicos in #13824
  • Do not mutate model_config attribute by @Viicos in #13825
  • Reject newlines in NameEmail validation by @Viicos in #13897 behavior changed · inferred
Fixes
  • Reject large exponents in Fraction validation by @Viicos in #13944. Addresses https://github.com/pydantic/pydantic/security/advisories/GHSA-gj4f-r7mf-jjxh.
  • Avoid validating URL prefix multiple times in multi host URLs by @Viicos in #13945. Addresses https://github.com/pydantic/pydantic/security/advisories/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 removed · inferred
  • Catch OverflowError during ByteSize validation by @Viicos in #13850
  • Require multiple_of constraints to be positive by @Viicos in #13862 behavior changed · inferred
  • 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: https://github.com/pydantic/pydantic/compare/v2.13.0...v2.14.0

View original

Upgraded? How did it go?

Discussion