New
v2.12.0b1 2025-10-03
v2.12.0b1 (2025-10-03)
This is the first beta release of the upcoming 2.12 release.
What's Changed
Packaging
- Bump
pydantic-coreto v2.40.1 by @Viicos in #12314
New Features
- Add support for
exclude_ifat the field level by @andresliszt in #12141 - Add
ValidateAsannotation helper by @Viicos in #11942 - Add configuration options for validation and JSON serialization of temporal types by @ollz272 in #12068
- Add support for PEP 728 by @Viicos in #12179
- Add field name in serialization error by @NicolasPllr1 in pydantic-core#1799
- Add option to preserve empty URL paths by @davidhewitt in pydantic-core#1789
Changes
- Raise error if an incompatible
pydantic-coreversion is installed by @Viicos in #12196 - Remove runtime warning for experimental features by @Viicos in #12265
- Warn if registering virtual subclasses on Pydantic models by @Viicos in #11669
Fixes
- Fix
__getattr__()behavior on Pydantic models when a property raised anAttributeErrorand extra values are present by @raspuchin in #12106 - Add test to prevent regression with Pydantic models used as annotated metadata by @Viicos in #12133
- Allow to use property setters on Pydantic dataclasses with
validate_assignmentset by @Viicos in #12173 - Fix mypy v2 plugin for upcoming mypy release by @cdce8p in #12209
- Respect custom title in functions JSON Schema by @Viicos in #11892
- Fix
ImportStringJSON serialization for objects with anameattribute by @chr1sj0nes in #12219 - Do not error on fields overridden by methods in the mypy plugin by @Viicos in #12290