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