What's Changed
- Split "pipx install" setup command into two commands on the documentation site by @nomadmtb in #6869
- Deprecate
Field.include
by @hramezani in #6852 - Fix typo in default factory error msg by @hramezani in #6880
- Simplify handling of typing.Annotated in GenerateSchema by @dmontagu in #6887
- Re-enable fastapi tests in CI by @dmontagu in #6883
- Make it harder to hit collisions with json schema defrefs by @dmontagu in #6566
- Cleaner error for invalid input to
Path
fields by @samuelcolvin in #6903 - 📝 support Coordinate Type by @yezz123 in #6906
- Fix
ForwardRef
wrapper for py 3.10.0 (shim until bpo-45166) by @randomir in #6919 - Fix misbehavior related to copying of RootModel by @dmontagu in #6918
- Fix issue with recursion error caused by ParamSpec by @dmontagu in #6923
- Add section about Constrained classes to the Migration Guide by @Kludex in #6924
- Use
main
branch for badge links by @Viicos in #6925 - Add test for v1/v2 Annotated discrepancy by @carlbordum in #6926
- Make the v1 mypy plugin work with both v1 and v2 by @dmontagu in #6921
- Fix issue where generic models couldn't be parametrized with BaseModel by @dmontagu in #6933
- Remove xfail for discriminated union with alias by @dmontagu in #6938
- add field_serializer to computed_field by @andresliszt in #6965
- Use union_schema with Type[Union[...]] by @JeanArhancet in #6952
- Fix inherited typeddict attributes / config by @adriangb in #6981
- fix dataclass annotated before validator called twice by @davidhewitt in #6998
- Update test-fastapi deselected tests by @hramezani in #7014
- Fix validator doc format by @hramezani in #7015
- Fix typo in docstring of model_json_schema by @AdamVinch-Federated in #7032
- remove unused "type ignores" with pyright by @samuelcolvin in #7026
- Add benchmark representing FastAPI startup time by @adriangb in #7030
- Fix json_encoders for Enum subclasses by @adriangb in #7029
- Update docstring of
ser_json_bytes
regarding base64 encoding by @Viicos in #7052 - Allow
@validate_call
to work on async methods by @adriangb in #7046 - Fix: mypy error with
Settings
andSettingsConfigDict
by @JeanArhancet in #7002 - Fix some typos (repeated words and it's/its) by @eumiro in #7063
- Fix the typo in docstring by @harunyasar in #7062
- Docs: Fix broken URL in the pydantic-settings package recommendation by @swetjen in #6995
- Handle constraints being applied to schemas that don't accept it by @adriangb in #6951
- Replace almost_equal_floats with math.isclose by @eumiro in #7082
- bump pydantic-core to 2.5.0 by @davidhewitt in #7077
- Add
short_version
and use it in links by @hramezani in #7115 - 📝 Add usage link to
RootModel
by @Kludex in #7113 - Revert "Fix default port for mongosrv DSNs (#6827)" by @Kludex in #7116
- Clarify validate_default and _Unset handling in usage docs and migration guide by @benbenbang in #6950
- Tweak documentation of
Field.exclude
by @Viicos in #7086 - Do not require
validate_assignment
to useField.frozen
by @Viicos in #7103 - tweaks to
_core_utils
by @samuelcolvin in #7040 - Make DefaultDict working with set by @hramezani in #7126
- Don't always require typing.Generic as a base for partially parametrized models by @dmontagu in #7119
- Fix issue with JSON schema incorrectly using parent class core schema by @dmontagu in #7020
- Fix xfailed test related to TypedDict and alias_generator by @dmontagu in #6940
- Improve error message for NameEmail by @dmontagu in #6939
- Fix generic computed fields by @dmontagu in #6988
- Reflect namedtuple default values during validation by @dmontagu in #7144
- Update dependencies, fix pydantic-core usage, fix CI issues by @dmontagu in #7150
- Add mypy 1.5.0 by @hramezani in #7118
- Handle non-json native enum values by @adriangb in #7056
- document
round_trip
in Json type documentation by @jc-louis in #7137 - Relax signature checks to better support builtins and C extension functions as validators by @adriangb in #7101
- add union_mode='left_to_right' by @davidhewitt in #7151
- Include an error message hint for inherited ordering by @yvalencia91 in #7124
- Fix one docs link and resolve some warnings for two others by @dmontagu in #7153
- Include Field extra keys name in warning by @hramezani in #7136
- Prepare for v2.2.0 by @dmontagu in #7157
New Contributors
- @nomadmtb made their first contribution in #6869
- @RS-Credentive made their first contribution in #6878
- @ialarmedalien made their first contribution in #6886
- @randomir made their first contribution in #6919
- @carlbordum made their first contribution in #6926
- @vishallama made their first contribution in #6947
- @andresliszt made their first contribution in #6965
- @AdamVinch-Federated made their first contribution in #7032
- @eumiro made their first contribution in #7063
- @harunyasar made their first contribution in #7062
- @mo1ein made their first contribution in #7074
- @swetjen made their first contribution in #6995
- @benbenbang made their first contribution in #6950
- @jc-louis made their first contribution in #7137
- @yvalencia91 made their first contribution in #7124
Full Changelog: v2.1.1...v2.2.0