Repository navigation
v2.14.0b2 2026-09-09
Pre-release
Pre-release
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