Regular expression denial of service in Pydantic < 2.4.0, < 1.10.13 allows remote attackers to cause denial of service via a crafted email string.
Release Notes
pydantic/pydantic (pydantic)
### [`v1.10.13`](https://togithub.com/pydantic/pydantic/blob/HEAD/HISTORY.md#v11013-2023-09-27)
[Compare Source](https://togithub.com/pydantic/pydantic/compare/v1.10.12...v1.10.13)
- Fix: Add max length check to `pydantic.validate_email`, [#7673](https://togithub.com/pydantic/pydantic/issues/7673) by [@hramezani](https://togithub.com/hramezani)
- Docs: Fix pip commands to install v1, [#6930](https://togithub.com/pydantic/pydantic/issues/6930) by [@chbndrhnns](https://togithub.com/chbndrhnns)
### [`v1.10.12`](https://togithub.com/pydantic/pydantic/blob/HEAD/HISTORY.md#v11012-2023-07-24)
[Compare Source](https://togithub.com/pydantic/pydantic/compare/v1.10.11...v1.10.12)
- Fixes the `maxlen` property being dropped on `deque` validation. Happened only if the deque item has been typed. Changes the `_validate_sequence_like` func, [#6581](https://togithub.com/pydantic/pydantic/pull/6581) by [@maciekglowka](https://togithub.com/maciekglowka)
### [`v1.10.11`](https://togithub.com/pydantic/pydantic/blob/HEAD/HISTORY.md#v11011-2023-07-04)
[Compare Source](https://togithub.com/pydantic/pydantic/compare/v1.10.10...v1.10.11)
- Importing create_model in tools.py through relative path instead of absolute path - so that it doesn't import V2 code when copied over to V2 branch, [#6361](https://togithub.com/pydantic/pydantic/pull/6361) by [@SharathHuddar](https://togithub.com/SharathHuddar)
### [`v1.10.10`](https://togithub.com/pydantic/pydantic/blob/HEAD/HISTORY.md#v11010-2023-06-30)
[Compare Source](https://togithub.com/pydantic/pydantic/compare/v1.10.9...v1.10.10)
- Add Pydantic `Json` field support to settings management, [#6250](https://togithub.com/pydantic/pydantic/pull/6250) by [@hramezani](https://togithub.com/hramezani)
- Fixed literal validator errors for unhashable values, [#6188](https://togithub.com/pydantic/pydantic/pull/6188) by [@markus1978](https://togithub.com/markus1978)
- Fixed bug with generics receiving forward refs, [#6130](https://togithub.com/pydantic/pydantic/pull/6130) by [@mark-todd](https://togithub.com/mark-todd)
- Update install method of FastAPI for internal tests in CI, [#6117](https://togithub.com/pydantic/pydantic/pull/6117) by [@Kludex](https://togithub.com/Kludex)
### [`v1.10.9`](https://togithub.com/pydantic/pydantic/blob/HEAD/HISTORY.md#v1109-2023-06-07)
[Compare Source](https://togithub.com/pydantic/pydantic/compare/v1.10.8...v1.10.9)
- Fix trailing zeros not ignored in Decimal validation, [#5968](https://togithub.com/pydantic/pydantic/pull/5968) by [@hramezani](https://togithub.com/hramezani)
- Fix mypy plugin for v1.4.0, [#5928](https://togithub.com/pydantic/pydantic/pull/5928) by [@cdce8p](https://togithub.com/cdce8p)
- Add future and past date hypothesis strategies, [#5850](https://togithub.com/pydantic/pydantic/pull/5850) by [@bschoenmaeckers](https://togithub.com/bschoenmaeckers)
- Discourage usage of Cython 3 with Pydantic 1.x, [#5845](https://togithub.com/pydantic/pydantic/pull/5845) by [@lig](https://togithub.com/lig)
### [`v1.10.8`](https://togithub.com/pydantic/pydantic/blob/HEAD/HISTORY.md#v1108-2023-05-23)
[Compare Source](https://togithub.com/pydantic/pydantic/compare/v1.10.7...v1.10.8)
- Fix a bug in `Literal` usage with `typing-extension==4.6.0`, [#5826](https://togithub.com/pydantic/pydantic/pull/5826) by [@hramezani](https://togithub.com/hramezani)
- This solves the (closed) issue [#3849](https://togithub.com/pydantic/pydantic/pull/3849) where aliased fields that use discriminated union fail to validate when the data contains the non-aliased field name, [#5736](https://togithub.com/pydantic/pydantic/pull/5736) by [@benwah](https://togithub.com/benwah)
- Update email-validator dependency to >=2.0.0post2, [#5627](https://togithub.com/pydantic/pydantic/pull/5627) by [@adriangb](https://togithub.com/adriangb)
- update `AnyClassMethod` for changes in [python/typeshed#9771](https://togithub.com/python/typeshed/issues/9771), [#5505](https://togithub.com/pydantic/pydantic/pull/5505) by [@ITProKyle](https://togithub.com/ITProKyle)
### [`v1.10.7`](https://togithub.com/pydantic/pydantic/blob/HEAD/HISTORY.md#v1107-2023-03-22)
[Compare Source](https://togithub.com/pydantic/pydantic/compare/v1.10.6...v1.10.7)
- Fix creating schema from model using `ConstrainedStr` with `regex` as dict key, [#5223](https://togithub.com/pydantic/pydantic/pull/5223) by [@matejetz](https://togithub.com/matejetz)
- Address bug in mypy plugin caused by explicit_package_bases=True, [#5191](https://togithub.com/pydantic/pydantic/pull/5191) by [@dmontagu](https://togithub.com/dmontagu)
- Add implicit defaults in the mypy plugin for Field with no default argument, [#5190](https://togithub.com/pydantic/pydantic/pull/5190) by [@dmontagu](https://togithub.com/dmontagu)
- Fix schema generated for Enum values used as Literals in discriminated unions, [#5188](https://togithub.com/pydantic/pydantic/pull/5188) by [@javibookline](https://togithub.com/javibookline)
- Fix mypy failures caused by the pydantic mypy plugin when users define `from_orm` in their own classes, [#5187](https://togithub.com/pydantic/pydantic/pull/5187) by [@dmontagu](https://togithub.com/dmontagu)
- Fix `InitVar` usage with pydantic dataclasses, mypy version `1.1.1` and the custom mypy plugin, [#5162](https://togithub.com/pydantic/pydantic/pull/5162) by [@cdce8p](https://togithub.com/cdce8p)
### [`v1.10.6`](https://togithub.com/pydantic/pydantic/blob/HEAD/HISTORY.md#v1106-2023-03-08)
[Compare Source](https://togithub.com/pydantic/pydantic/compare/v1.10.5...v1.10.6)
- Implement logic to support creating validators from non standard callables by using defaults to identify them and unwrapping `functools.partial` and `functools.partialmethod` when checking the signature, [#5126](https://togithub.com/pydantic/pydantic/pull/5126) by [@JensHeinrich](https://togithub.com/JensHeinrich)
- Fix mypy plugin for v1.1.1, and fix `dataclass_transform` decorator for pydantic dataclasses, [#5111](https://togithub.com/pydantic/pydantic/pull/5111) by [@cdce8p](https://togithub.com/cdce8p)
- Raise `ValidationError`, not `ConfigError`, when a discriminator value is unhashable, [#4773](https://togithub.com/pydantic/pydantic/pull/4773) by [@kurtmckee](https://togithub.com/kurtmckee)
### [`v1.10.5`](https://togithub.com/pydantic/pydantic/blob/HEAD/HISTORY.md#v1105-2023-02-15)
[Compare Source](https://togithub.com/pydantic/pydantic/compare/v1.10.4...v1.10.5)
- Fix broken parametrized bases handling with `GenericModel`s with complex sets of models, [#5052](https://togithub.com/pydantic/pydantic/pull/5052) by [@MarkusSintonen](https://togithub.com/MarkusSintonen)
- Invalidate mypy cache if plugin config changes, [#5007](https://togithub.com/pydantic/pydantic/pull/5007) by [@cdce8p](https://togithub.com/cdce8p)
- Fix `RecursionError` when deep-copying dataclass types wrapped by pydantic, [#4949](https://togithub.com/pydantic/pydantic/pull/4949) by [@mbillingr](https://togithub.com/mbillingr)
- Fix `X | Y` union syntax breaking `GenericModel`, [#4146](https://togithub.com/pydantic/pydantic/pull/4146) by [@thenx](https://togithub.com/thenx)
- Switch coverage badge to show coverage for this branch/release, [#5060](https://togithub.com/pydantic/pydantic/pull/5060) by [@samuelcolvin](https://togithub.com/samuelcolvin)
### [`v1.10.4`](https://togithub.com/pydantic/pydantic/blob/HEAD/HISTORY.md#v1104-2022-12-30)
[Compare Source](https://togithub.com/pydantic/pydantic/compare/v1.10.3...v1.10.4)
- Change dependency to `typing-extensions>=4.2.0`, [#4885](https://togithub.com/pydantic/pydantic/pull/4885) by [@samuelcolvin](https://togithub.com/samuelcolvin)
### [`v1.10.3`](https://togithub.com/pydantic/pydantic/blob/HEAD/HISTORY.md#v1103-2022-12-29)
[Compare Source](https://togithub.com/pydantic/pydantic/compare/v1.10.2...v1.10.3)
**NOTE: v1.10.3 was ["yanked"](https://pypi.org/help/#yanked) from PyPI due to [#4885](https://togithub.com/pydantic/pydantic/pull/4885) which is fixed in v1.10.4**
- fix parsing of custom root models, [#4883](https://togithub.com/pydantic/pydantic/pull/4883) by [@gou177](https://togithub.com/gou177)
- fix: use dataclass proxy for frozen or empty dataclasses, [#4878](https://togithub.com/pydantic/pydantic/pull/4878) by [@PrettyWood](https://togithub.com/PrettyWood)
- Fix `schema` and `schema_json` on models where a model instance is a one of default values, [#4781](https://togithub.com/pydantic/pydantic/pull/4781) by [@Bobronium](https://togithub.com/Bobronium)
- Add Jina AI to sponsors on docs index page, [#4767](https://togithub.com/pydantic/pydantic/pull/4767) by [@samuelcolvin](https://togithub.com/samuelcolvin)
- fix: support assignment on `DataclassProxy`, [#4695](https://togithub.com/pydantic/pydantic/pull/4695) by [@PrettyWood](https://togithub.com/PrettyWood)
- Add `postgresql+psycopg` as allowed scheme for `PostgreDsn` to make it usable with SQLAlchemy 2, [#4689](https://togithub.com/pydantic/pydantic/pull/4689) by [@morian](https://togithub.com/morian)
- Allow dict schemas to have both `patternProperties` and `additionalProperties`, [#4641](https://togithub.com/pydantic/pydantic/pull/4641) by [@jparise](https://togithub.com/jparise)
- Fixes error passing None for optional lists with `unique_items`, [#4568](https://togithub.com/pydantic/pydantic/pull/4568) by [@mfulgo](https://togithub.com/mfulgo)
- Fix `GenericModel` with `Callable` param raising a `TypeError`, [#4551](https://togithub.com/pydantic/pydantic/pull/4551) by [@mfulgo](https://togithub.com/mfulgo)
- Fix field regex with `StrictStr` type annotation, [#4538](https://togithub.com/pydantic/pydantic/pull/4538) by [@sisp](https://togithub.com/sisp)
- Correct `dataclass_transform` keyword argument name from `field_descriptors` to `field_specifiers`, [#4500](https://togithub.com/pydantic/pydantic/pull/4500) by [@samuelcolvin](https://togithub.com/samuelcolvin)
- fix: avoid multiple calls of `__post_init__` when dataclasses are inherited, [#4487](https://togithub.com/pydantic/pydantic/pull/4487) by [@PrettyWood](https://togithub.com/PrettyWood)
- Reduce the size of binary wheels, [#2276](https://togithub.com/pydantic/pydantic/pull/2276) by [@samuelcolvin](https://togithub.com/samuelcolvin)
### [`v1.10.2`](https://togithub.com/pydantic/pydantic/blob/HEAD/HISTORY.md#v1102-2022-09-05)
[Compare Source](https://togithub.com/pydantic/pydantic/compare/v1.10.1...v1.10.2)
- **Revert Change:** Revert percent encoding of URL parts which was originally added in [#4224](https://togithub.com/pydantic/pydantic/pull/4224), [#4470](https://togithub.com/pydantic/pydantic/pull/4470) by [@samuelcolvin](https://togithub.com/samuelcolvin)
- Prevent long (length > `4_300`) strings/bytes as input to int fields, see
[python/cpython#95778](https://togithub.com/python/cpython/issues/95778) and
[CVE-2020-10735](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-10735), [#1477](https://togithub.com/pydantic/pydantic/pull/1477) by [@samuelcolvin](https://togithub.com/samuelcolvin)
- fix: dataclass wrapper was not always called, [#4477](https://togithub.com/pydantic/pydantic/pull/4477) by [@PrettyWood](https://togithub.com/PrettyWood)
- Use `tomllib` on Python 3.11 when parsing `mypy` configuration, [#4476](https://togithub.com/pydantic/pydantic/pull/4476) by [@hauntsaninja](https://togithub.com/hauntsaninja)
- Basic fix of `GenericModel` cache to detect order of arguments in `Union` models, [#4474](https://togithub.com/pydantic/pydantic/pull/4474) by [@sveinugu](https://togithub.com/sveinugu)
- Fix mypy plugin when using bare types like `list` and `dict` as `default_factory`, [#4457](https://togithub.com/pydantic/pydantic/pull/4457) by [@samuelcolvin](https://togithub.com/samuelcolvin)
### [`v1.10.1`](https://togithub.com/pydantic/pydantic/blob/HEAD/HISTORY.md#v11018-2024-08-22)
[Compare Source](https://togithub.com/pydantic/pydantic/compare/v1.10.0...v1.10.1)
- Eval type fix in V1 by [@sydney-runkle](https://togithub.com/sydney-runkle) in [https://github.com/pydantic/pydantic/pull/9751](https://togithub.com/pydantic/pydantic/pull/9751)
- Add `to_lower_camel` to `__all__` in `utils.py` by [@sydney-runkle](https://togithub.com/sydney-runkle) (direct commit)
- Fix `mypy` v1 plugin for mypy 1.11 release by [@flaeppe](https://togithub.com/flaeppe) in [https://github.com/pydantic/pydantic/pull/10139](https://togithub.com/pydantic/pydantic/pull/10139)
- Fix discriminator key used when discriminator has alias and `.schema(by_alias=False)` by [@exs-dwoodward](https://togithub.com/exs-dwoodward) in [https://github.com/pydantic/pydantic/pull/10146](https://togithub.com/pydantic/pydantic/pull/10146)
### [`v1.10.0`](https://togithub.com/pydantic/pydantic/blob/HEAD/HISTORY.md#v1100-2022-08-30)
[Compare Source](https://togithub.com/pydantic/pydantic/compare/v1.9.2...v1.10.0)
- Refactor the whole *pydantic* `dataclass` decorator to really act like its standard lib equivalent.
It hence keeps `__eq__`, `__hash__`, ... and makes comparison with its non-validated version possible.
It also fixes usage of `frozen` dataclasses in fields and usage of `default_factory` in nested dataclasses.
The support of `Config.extra` has been added.
Finally, config customization directly via a `dict` is now possible, [#2557](https://togithub.com/pydantic/pydantic/pull/2557) by [@PrettyWood](https://togithub.com/PrettyWood)
**BREAKING CHANGES:**
- The `compiled` boolean (whether *pydantic* is compiled with cython) has been moved from `main.py` to `version.py`
- Now that `Config.extra` is supported, `dataclass` ignores by default extra arguments (like `BaseModel`)
- Fix PEP487 `__set_name__` protocol in `BaseModel` for PrivateAttrs, [#4407](https://togithub.com/pydantic/pydantic/pull/4407) by [@tlambert03](https://togithub.com/tlambert03)
- Allow for custom parsing of environment variables via `parse_env_var` in `Config`, [#4406](https://togithub.com/pydantic/pydantic/pull/4406) by [@acmiyaguchi](https://togithub.com/acmiyaguchi)
- Rename `master` to `main`, [#4405](https://togithub.com/pydantic/pydantic/pull/4405) by [@hramezani](https://togithub.com/hramezani)
- Fix `StrictStr` does not raise `ValidationError` when `max_length` is present in `Field`, [#4388](https://togithub.com/pydantic/pydantic/pull/4388) by [@hramezani](https://togithub.com/hramezani)
- Make `SecretStr` and `SecretBytes` hashable, [#4387](https://togithub.com/pydantic/pydantic/pull/4387) by [@chbndrhnns](https://togithub.com/chbndrhnns)
- Fix `StrictBytes` does not raise `ValidationError` when `max_length` is present in `Field`, [#4380](https://togithub.com/pydantic/pydantic/pull/4380) by [@JeanArhancet](https://togithub.com/JeanArhancet)
- Add support for bare `type`, [#4375](https://togithub.com/pydantic/pydantic/pull/4375) by [@hramezani](https://togithub.com/hramezani)
- Support Python 3.11, including binaries for 3.11 in PyPI, [#4374](https://togithub.com/pydantic/pydantic/pull/4374) by [@samuelcolvin](https://togithub.com/samuelcolvin)
- Add support for `re.Pattern`, [#4366](https://togithub.com/pydantic/pydantic/pull/4366) by [@hramezani](https://togithub.com/hramezani)
- Fix `__post_init_post_parse__` is incorrectly passed keyword arguments when no `__post_init__` is defined, [#4361](https://togithub.com/pydantic/pydantic/pull/4361) by [@hramezani](https://togithub.com/hramezani)
- Fix implicitly importing `ForwardRef` and `Callable` from `pydantic.typing` instead of `typing` and also expose `MappingIntStrAny`, [#4358](https://togithub.com/pydantic/pydantic/pull/4358) by [@aminalaee](https://togithub.com/aminalaee)
- remove `Any` types from the `dataclass` decorator so it can be used with the `disallow_any_expr` mypy option, [#4356](https://togithub.com/pydantic/pydantic/pull/4356) by [@DetachHead](https://togithub.com/DetachHead)
- moved repo to `pydantic/pydantic`, [#4348](https://togithub.com/pydantic/pydantic/pull/4348) by [@yezz123](https://togithub.com/yezz123)
- fix "extra fields not permitted" error when dataclass with `Extra.forbid` is validated multiple times, [#4343](https://togithub.com/pydantic/pydantic/pull/4343) by [@detachhead](https://togithub.com/detachhead)
- Add Python 3.9 and 3.10 examples to docs, [#4339](https://togithub.com/pydantic/pydantic/pull/4339) by [@Bobronium](https://togithub.com/Bobronium)
- Discriminated union models now use `oneOf` instead of `anyOf` when generating OpenAPI schema definitions, [#4335](https://togithub.com/pydantic/pydantic/pull/4335) by [@MaxwellPayne](https://togithub.com/MaxwellPayne)
- Allow type checkers to infer inner type of `Json` type. `Json[list[str]]` will be now inferred as `list[str]`,
`Json[Any]` should be used instead of plain `Json`.
Runtime behaviour is not changed, [#4332](https://togithub.com/pydantic/pydantic/pull/4332) by [@Bobronium](https://togithub.com/Bobronium)
- Allow empty string aliases by using a `alias is not None` check, rather than `bool(alias)`, [#4253](https://togithub.com/pydantic/pydantic/pull/4253) by [@sergeytsaplin](https://togithub.com/sergeytsaplin)
- Update `ForwardRef`s in `Field.outer_type_`, [#4249](https://togithub.com/pydantic/pydantic/pull/4249) by [@JacobHayes](https://togithub.com/JacobHayes)
- The use of `__dataclass_transform__` has been replaced by `typing_extensions.dataclass_transform`, which is the preferred way to mark pydantic models as a dataclass under [PEP 681](https://peps.python.org/pep-0681/), [#4241](https://togithub.com/pydantic/pydantic/pull/4241) by [@multimeric](https://togithub.com/multimeric)
- Use parent model's `Config` when validating nested `NamedTuple` fields, [#4219](https://togithub.com/pydantic/pydantic/pull/4219) by [@synek](https://togithub.com/synek)
- Update `BaseModel.construct` to work with aliased Fields, [#4192](https://togithub.com/pydantic/pydantic/pull/4192) by [@kylebamos](https://togithub.com/kylebamos)
- Catch certain raised errors in `smart_deepcopy` and revert to `deepcopy` if so, [#4184](https://togithub.com/pydantic/pydantic/pull/4184) by [@coneybeare](https://togithub.com/coneybeare)
- Add `Config.anystr_upper` and `to_upper` kwarg to constr and conbytes, [#4165](https://togithub.com/pydantic/pydantic/pull/4165) by [@satheler](https://togithub.com/satheler)
- Fix JSON schema for `set` and `frozenset` when they include default values, [#4155](https://togithub.com/pydantic/pydantic/pull/4155) by [@aminalaee](https://togithub.com/aminalaee)
- Teach the mypy plugin that methods decorated by `@validator` are classmethods, [#4102](https://togithub.com/pydantic/pydantic/pull/4102) by [@DMRobertson](https://togithub.com/DMRobertson)
- Improve mypy plugin's ability to detect required fields, [#4086](https://togithub.com/pydantic/pydantic/pull/4086) by [@richardxia](https://togithub.com/richardxia)
- Support fields of type `Type[]` in schema, [#4051](https://togithub.com/pydantic/pydantic/pull/4051) by [@aminalaee](https://togithub.com/aminalaee)
- Add `default` value in JSON Schema when `const=True`, [#4031](https://togithub.com/pydantic/pydantic/pull/4031) by [@aminalaee](https://togithub.com/aminalaee)
- Adds reserved word check to signature generation logic, [#4011](https://togithub.com/pydantic/pydantic/pull/4011) by [@strue36](https://togithub.com/strue36)
- Fix Json strategy failure for the complex nested field, [#4005](https://togithub.com/pydantic/pydantic/pull/4005) by [@sergiosim](https://togithub.com/sergiosim)
- Add JSON-compatible float constraint `allow_inf_nan`, [#3994](https://togithub.com/pydantic/pydantic/pull/3994) by [@tiangolo](https://togithub.com/tiangolo)
- Remove undefined behaviour when `env_prefix` had characters in common with `env_nested_delimiter`, [#3975](https://togithub.com/pydantic/pydantic/pull/3975) by [@arsenron](https://togithub.com/arsenron)
- Support generics model with `create_model`, [#3945](https://togithub.com/pydantic/pydantic/pull/3945) by [@hot123s](https://togithub.com/hot123s)
- allow submodels to overwrite extra field info, [#3934](https://togithub.com/pydantic/pydantic/pull/3934) by [@PrettyWood](https://togithub.com/PrettyWood)
- Document and test structural pattern matching ([PEP 636](https://peps.python.org/pep-0636/)) on `BaseModel`, [#3920](https://togithub.com/pydantic/pydantic/pull/3920) by [@irgolic](https://togithub.com/irgolic)
- Fix incorrect deserialization of python timedelta object to ISO 8601 for negative time deltas.
Minus was serialized in incorrect place ("P-1DT23H59M59.888735S" instead of correct "-P1DT23H59M59.888735S"), [#3899](https://togithub.com/pydantic/pydantic/pull/3899) by [@07pepa](https://togithub.com/07pepa)
- Fix validation of discriminated union fields with an alias when passing a model instance, [#3846](https://togithub.com/pydantic/pydantic/pull/3846) by [@chornsby](https://togithub.com/chornsby)
- Add a CockroachDsn type to validate CockroachDB connection strings. The type
supports the following schemes: `cockroachdb`, `cockroachdb+psycopg2` and `cockroachdb+asyncpg`, [#3839](https://togithub.com/pydantic/pydantic/pull/3839) by [@blubber](https://togithub.com/blubber)
- Fix MyPy plugin to not override pre-existing `__init__` method in models, [#3824](https://togithub.com/pydantic/pydantic/pull/3824) by [@patrick91](https://togithub.com/patrick91)
- Fix mypy version checking, [#3783](https://togithub.com/pydantic/pydantic/pull/3783) by [@KotlinIsland](https://togithub.com/KotlinIsland)
- support overwriting dunder attributes of `BaseModel` instances, [#3777](https://togithub.com/pydantic/pydantic/pull/3777) by [@PrettyWood](https://togithub.com/PrettyWood)
- Added `ConstrainedDate` and `condate`, [#3740](https://togithub.com/pydantic/pydantic/pull/3740) by [@hottwaj](https://togithub.com/hottwaj)
- Support `kw_only` in dataclasses, [#3670](https://togithub.com/pydantic/pydantic/pull/3670) by [@detachhead](https://togithub.com/detachhead)
- Add comparison method for `Color` class, [#3646](https://togithub.com/pydantic/pydantic/pull/3646) by [@aminalaee](https://togithub.com/aminalaee)
- Drop support for python3.6, associated cleanup, [#3605](https://togithub.com/pydantic/pydantic/pull/3605) by [@samuelcolvin](https://togithub.com/samuelcolvin)
- created new function `to_lower_camel()` for "non pascal case" camel case, [#3463](https://togithub.com/pydantic/pydantic/pull/3463) by [@schlerp](https://togithub.com/schlerp)
- Add checks to `default` and `default_factory` arguments in Mypy plugin, [#3430](https://togithub.com/pydantic/pydantic/pull/3430) by [@klaa97](https://togithub.com/klaa97)
- fix mangling of `inspect.signature` for `BaseModel`, [#3413](https://togithub.com/pydantic/pydantic/pull/3413) by [@fix-inspect-signature](https://togithub.com/fix-inspect-signature)
- Adds the `SecretField` abstract class so that all the current and future secret fields like `SecretStr` and `SecretBytes` will derive from it, [#3409](https://togithub.com/pydantic/pydantic/pull/3409) by [@expobrain](https://togithub.com/expobrain)
- Support multi hosts validation in `PostgresDsn`, [#3337](https://togithub.com/pydantic/pydantic/pull/3337) by [@rglsk](https://togithub.com/rglsk)
- Fix parsing of very small numeric timedelta values, [#3315](https://togithub.com/pydantic/pydantic/pull/3315) by [@samuelcolvin](https://togithub.com/samuelcolvin)
- Update `SecretsSettingsSource` to respect `config.case_sensitive`, [#3273](https://togithub.com/pydantic/pydantic/pull/3273) by [@JeanArhancet](https://togithub.com/JeanArhancet)
- Add MongoDB network data source name (DSN) schema, [#3229](https://togithub.com/pydantic/pydantic/pull/3229) by [@snosratiershad](https://togithub.com/snosratiershad)
- Add support for multiple dotenv files, [#3222](https://togithub.com/pydantic/pydantic/pull/3222) by [@rekyungmin](https://togithub.com/rekyungmin)
- Raise an explicit `ConfigError` when multiple fields are incorrectly set for a single validator, [#3215](https://togithub.com/pydantic/pydantic/pull/3215) by [@SunsetOrange](https://togithub.com/SunsetOrange)
- Allow ellipsis on `Field`s inside `Annotated` for `TypedDicts` required, [#3133](https://togithub.com/pydantic/pydantic/pull/3133) by [@ezegomez](https://togithub.com/ezegomez)
- Catch overflow errors in `int_validator`, [#3112](https://togithub.com/pydantic/pydantic/pull/3112) by [@ojii](https://togithub.com/ojii)
- Adds a `__rich_repr__` method to `Representation` class which enables pretty printing with [Rich](https://togithub.com/willmcgugan/rich), [#3099](https://togithub.com/pydantic/pydantic/pull/3099) by [@willmcgugan](https://togithub.com/willmcgugan)
- Add percent encoding in `AnyUrl` and descendent types, [#3061](https://togithub.com/pydantic/pydantic/pull/3061) by [@FaresAhmedb](https://togithub.com/FaresAhmedb)
- `validate_arguments` decorator now supports `alias`, [#3019](https://togithub.com/pydantic/pydantic/pull/3019) by [@MAD-py](https://togithub.com/MAD-py)
- Avoid `__dict__` and `__weakref__` attributes in `AnyUrl` and IP address fields, [#2890](https://togithub.com/pydantic/pydantic/pull/2890) by [@nuno-andre](https://togithub.com/nuno-andre)
- Add ability to use `Final` in a field type annotation, [#2766](https://togithub.com/pydantic/pydantic/pull/2766) by [@uriyyo](https://togithub.com/uriyyo)
- Update requirement to `typing_extensions>=4.1.0` to guarantee `dataclass_transform` is available, [#4424](https://togithub.com/pydantic/pydantic/pull/4424) by [@commonism](https://togithub.com/commonism)
- Add Explosion and AWS to main sponsors, [#4413](https://togithub.com/pydantic/pydantic/pull/4413) by [@samuelcolvin](https://togithub.com/samuelcolvin)
- Update documentation for `copy_on_model_validation` to reflect recent changes, [#4369](https://togithub.com/pydantic/pydantic/pull/4369) by [@samuelcolvin](https://togithub.com/samuelcolvin)
- Runtime warning if `__slots__` is passed to `create_model`, `__slots__` is then ignored, [#4432](https://togithub.com/pydantic/pydantic/pull/4432) by [@samuelcolvin](https://togithub.com/samuelcolvin)
- Add type hints to `BaseSettings.Config` to avoid mypy errors, also correct mypy version compatibility notice in docs, [#4450](https://togithub.com/pydantic/pydantic/pull/4450) by [@samuelcolvin](https://togithub.com/samuelcolvin)
### [`v1.9.2`](https://togithub.com/pydantic/pydantic/blob/HEAD/HISTORY.md#v192-2022-08-11)
[Compare Source](https://togithub.com/pydantic/pydantic/compare/v1.9.1...v1.9.2)
**Revert Breaking Change**: *v1.9.1* introduced a breaking change where model fields were
deep copied by default, this release reverts the default behaviour to match *v1.9.0* and before,
while also allow deep-copy behaviour via `copy_on_model_validation = 'deep'`. See [#4092](https://togithub.com/pydantic/pydantic/pull/4092) for more information.
- Allow for shallow copies of model fields, `Config.copy_on_model_validation` is now a str which must be
`'none'`, `'deep'`, or `'shallow'` corresponding to not copying, deep copy & shallow copy; default `'shallow'`,
[#4093](https://togithub.com/pydantic/pydantic/pull/4093) by [@timkpaine](https://togithub.com/timkpaine)
### [`v1.9.1`](https://togithub.com/pydantic/pydantic/blob/HEAD/HISTORY.md#v191-2022-05-19)
[Compare Source](https://togithub.com/pydantic/pydantic/compare/v1.9.0...v1.9.1)
Thank you to pydantic's sponsors:
[@tiangolo](https://togithub.com/tiangolo), [@stellargraph](https://togithub.com/stellargraph), [@JonasKs](https://togithub.com/JonasKs), [@grillazz](https://togithub.com/grillazz), [@Mazyod](https://togithub.com/Mazyod), [@kevinalh](https://togithub.com/kevinalh), [@chdsbd](https://togithub.com/chdsbd), [@povilasb](https://togithub.com/povilasb), [@povilasb](https://togithub.com/povilasb), [@jina-ai](https://togithub.com/jina-ai),
[@mainframeindustries](https://togithub.com/mainframeindustries), [@robusta-dev](https://togithub.com/robusta-dev), [@SendCloud](https://togithub.com/SendCloud), [@rszamszur](https://togithub.com/rszamszur), [@jodal](https://togithub.com/jodal), [@hardbyte](https://togithub.com/hardbyte), [@corleyma](https://togithub.com/corleyma), [@daddycocoaman](https://togithub.com/daddycocoaman),
[@Rehket](https://togithub.com/Rehket), [@jokull](https://togithub.com/jokull), [@reillysiemens](https://togithub.com/reillysiemens), [@westonsteimel](https://togithub.com/westonsteimel), [@primer-io](https://togithub.com/primer-io), [@koxudaxi](https://togithub.com/koxudaxi), [@browniebroke](https://togithub.com/browniebroke), [@stradivari96](https://togithub.com/stradivari96),
[@adriangb](https://togithub.com/adriangb), [@kamalgill](https://togithub.com/kamalgill), [@jqueguiner](https://togithub.com/jqueguiner), [@dev-zero](https://togithub.com/dev-zero), [@datarootsio](https://togithub.com/datarootsio), [@RedCarpetUp](https://togithub.com/RedCarpetUp)
for their kind support.
- Limit the size of `generics._generic_types_cache` and `generics._assigned_parameters`
to avoid unlimited increase in memory usage, [#4083](https://togithub.com/pydantic/pydantic/pull/4083) by [@samuelcolvin](https://togithub.com/samuelcolvin)
- Add Jupyverse and FPS as Jupyter projects using pydantic, [#4082](https://togithub.com/pydantic/pydantic/pull/4082) by [@davidbrochart](https://togithub.com/davidbrochart)
- Speedup `__isinstancecheck__` on pydantic models when the type is not a model, may also avoid memory "leaks", [#4081](https://togithub.com/pydantic/pydantic/pull/4081) by [@samuelcolvin](https://togithub.com/samuelcolvin)
- Fix in-place modification of `FieldInfo` that caused problems with PEP 593 type aliases, [#4067](https://togithub.com/pydantic/pydantic/pull/4067) by [@adriangb](https://togithub.com/adriangb)
- Add support for autocomplete in VS Code via `__dataclass_transform__` when using `pydantic.dataclasses.dataclass`, [#4006](https://togithub.com/pydantic/pydantic/pull/4006) by [@giuliano-oliveira](https://togithub.com/giuliano-oliveira)
- Remove benchmarks from codebase and docs, [#3973](https://togithub.com/pydantic/pydantic/pull/3973) by [@samuelcolvin](https://togithub.com/samuelcolvin)
- Typing checking with pyright in CI, improve docs on vscode/pylance/pyright, [#3972](https://togithub.com/pydantic/pydantic/pull/3972) by [@samuelcolvin](https://togithub.com/samuelcolvin)
- Fix nested Python dataclass schema regression, [#3819](https://togithub.com/pydantic/pydantic/pull/3819) by [@himbeles](https://togithub.com/himbeles)
- Update documentation about lazy evaluation of sources for Settings, [#3806](https://togithub.com/pydantic/pydantic/pull/3806) by [@garyd203](https://togithub.com/garyd203)
- Prevent subclasses of bytes being converted to bytes, [#3706](https://togithub.com/pydantic/pydantic/pull/3706) by [@samuelcolvin](https://togithub.com/samuelcolvin)
- Fixed "error checking inheritance of" when using PEP585 and PEP604 type hints, [#3681](https://togithub.com/pydantic/pydantic/pull/3681) by [@aleksul](https://togithub.com/aleksul)
- Allow self referencing `ClassVar`s in models, [#3679](https://togithub.com/pydantic/pydantic/pull/3679) by [@samuelcolvin](https://togithub.com/samuelcolvin)
- **Breaking Change, see [#4106](https://togithub.com/pydantic/pydantic/pull/4106)**: Fix issue with self-referencing dataclass, [#3675](https://togithub.com/pydantic/pydantic/pull/3675) by [@uriyyo](https://togithub.com/uriyyo)
- Include non-standard port numbers in rendered URLs, [#3652](https://togithub.com/pydantic/pydantic/pull/3652) by [@dolfinus](https://togithub.com/dolfinus)
- `Config.copy_on_model_validation` does a deep copy and not a shallow one, [#3641](https://togithub.com/pydantic/pydantic/pull/3641) by [@PrettyWood](https://togithub.com/PrettyWood)
- fix: clarify that discriminated unions do not support singletons, [#3636](https://togithub.com/pydantic/pydantic/pull/3636) by [@tommilligan](https://togithub.com/tommilligan)
- Add `read_text(encoding='utf-8')` for `setup.py`, [#3625](https://togithub.com/pydantic/pydantic/pull/3625) by [@hswong3i](https://togithub.com/hswong3i)
- Fix JSON Schema generation for Discriminated Unions within lists, [#3608](https://togithub.com/pydantic/pydantic/pull/3608) by [@samuelcolvin](https://togithub.com/samuelcolvin)
### [`v1.9.0`](https://togithub.com/pydantic/pydantic/blob/HEAD/HISTORY.md#v190-2021-12-31)
[Compare Source](https://togithub.com/pydantic/pydantic/compare/v1.8.2...v1.9.0)
Thank you to pydantic's sponsors:
[@sthagen](https://togithub.com/sthagen), [@timdrijvers](https://togithub.com/timdrijvers), [@toinbis](https://togithub.com/toinbis), [@koxudaxi](https://togithub.com/koxudaxi), [@ginomempin](https://togithub.com/ginomempin), [@primer-io](https://togithub.com/primer-io), [@and-semakin](https://togithub.com/and-semakin), [@westonsteimel](https://togithub.com/westonsteimel), [@reillysiemens](https://togithub.com/reillysiemens),
[@es3n1n](https://togithub.com/es3n1n), [@jokull](https://togithub.com/jokull), [@JonasKs](https://togithub.com/JonasKs), [@Rehket](https://togithub.com/Rehket), [@corleyma](https://togithub.com/corleyma), [@daddycocoaman](https://togithub.com/daddycocoaman), [@hardbyte](https://togithub.com/hardbyte), [@datarootsio](https://togithub.com/datarootsio), [@jodal](https://togithub.com/jodal), [@aminalaee](https://togithub.com/aminalaee), [@rafsaf](https://togithub.com/rafsaf),
[@jqueguiner](https://togithub.com/jqueguiner), [@chdsbd](https://togithub.com/chdsbd), [@kevinalh](https://togithub.com/kevinalh), [@Mazyod](https://togithub.com/Mazyod), [@grillazz](https://togithub.com/grillazz), [@JonasKs](https://togithub.com/JonasKs), [@simw](https://togithub.com/simw), [@leynier](https://togithub.com/leynier), [@xfenix](https://togithub.com/xfenix)
for their kind support.
##### Highlights
- add Python 3.10 support, [#2885](https://togithub.com/pydantic/pydantic/pull/2885) by [@PrettyWood](https://togithub.com/PrettyWood)
- [Discriminated unions](https://docs.pydantic.dev/usage/types/#discriminated-unions-aka-tagged-unions), [#619](https://togithub.com/pydantic/pydantic/pull/619) by [@PrettyWood](https://togithub.com/PrettyWood)
- [`Config.smart_union` for better union logic](https://docs.pydantic.dev/usage/model_config/#smart-union), [#2092](https://togithub.com/pydantic/pydantic/pull/2092) by [@PrettyWood](https://togithub.com/PrettyWood)
- Binaries for Macos M1 CPUs, [#3498](https://togithub.com/pydantic/pydantic/pull/3498) by [@samuelcolvin](https://togithub.com/samuelcolvin)
- Complex types can be set via [nested environment variables](https://docs.pydantic.dev/usage/settings/#parsing-environment-variable-values), e.g. `foo___bar`, [#3159](https://togithub.com/pydantic/pydantic/pull/3159) by [@Air-Mark](https://togithub.com/Air-Mark)
- add a dark mode to *pydantic* documentation, [#2913](https://togithub.com/pydantic/pydantic/pull/2913) by [@gbdlin](https://togithub.com/gbdlin)
- Add support for autocomplete in VS Code via `__dataclass_transform__`, [#2721](https://togithub.com/pydantic/pydantic/pull/2721) by [@tiangolo](https://togithub.com/tiangolo)
- Add "exclude" as a field parameter so that it can be configured using model config, [#660](https://togithub.com/pydantic/pydantic/pull/660) by [@daviskirk](https://togithub.com/daviskirk)
##### v1.9.0 (2021-12-31) Changes
- Apply `update_forward_refs` to `Config.json_encodes` prevent name clashes in types defined via strings, [#3583](https://togithub.com/pydantic/pydantic/pull/3583) by [@samuelcolvin](https://togithub.com/samuelcolvin)
- Extend pydantic's mypy plugin to support mypy versions `0.910`, `0.920`, `0.921` & `0.930`, [#3573](https://togithub.com/pydantic/pydantic/pull/3573) & [#3594](https://togithub.com/pydantic/pydantic/pull/3594) by [@PrettyWood](https://togithub.com/PrettyWood), [@christianbundy](https://togithub.com/christianbundy), [@samuelcolvin](https://togithub.com/samuelcolvin)
##### v1.9.0a2 (2021-12-24) Changes
- support generic models with discriminated union, [#3551](https://togithub.com/pydantic/pydantic/pull/3551) by [@PrettyWood](https://togithub.com/PrettyWood)
- keep old behaviour of `json()` by default, [#3542](https://togithub.com/pydantic/pydantic/pull/3542) by [@PrettyWood](https://togithub.com/PrettyWood)
- Removed typing-only `__root__` attribute from `BaseModel`, [#3540](https://togithub.com/pydantic/pydantic/pull/3540) by [@layday](https://togithub.com/layday)
- Build Python 3.10 wheels, [#3539](https://togithub.com/pydantic/pydantic/pull/3539) by [@mbachry](https://togithub.com/mbachry)
- Fix display of `extra` fields with model `__repr__`, [#3234](https://togithub.com/pydantic/pydantic/pull/3234) by [@cocolman](https://togithub.com/cocolman)
- models copied via `Config.copy_on_model_validation` always have all fields, [#3201](https://togithub.com/pydantic/pydantic/pull/3201) by [@PrettyWood](https://togithub.com/PrettyWood)
- nested ORM from nested dictionaries, [#3182](https://togithub.com/pydantic/pydantic/pull/3182) by [@PrettyWood](https://togithub.com/PrettyWood)
- fix link to discriminated union section by [@PrettyWood](https://togithub.com/PrettyWood)
##### v1.9.0a1 (2021-12-18) Changes
- Add support for `Decimal`-specific validation configurations in `Field()`, additionally to using `condecimal()`,
to allow better support from editors and tooling, [#3507](https://togithub.com/pydantic/pydantic/pull/3507) by [@tiangolo](https://togithub.com/tiangolo)
- Add `arm64` binaries suitable for MacOS with an M1 CPU to PyPI, [#3498](https://togithub.com/pydantic/pydantic/pull/3498) by [@samuelcolvin](https://togithub.com/samuelcolvin)
- Fix issue where `None` was considered invalid when using a `Union` type containing `Any` or `object`, [#3444](https://togithub.com/pydantic/pydantic/pull/3444) by [@tharradine](https://togithub.com/tharradine)
- When generating field schema, pass optional `field` argument (of type
`pydantic.fields.ModelField`) to `__modify_schema__()` if present, [#3434](https://togithub.com/pydantic/pydantic/pull/3434) by [@jasujm](https://togithub.com/jasujm)
- Fix issue when pydantic fail to parse `typing.ClassVar` string type annotation, [#3401](https://togithub.com/pydantic/pydantic/pull/3401) by [@uriyyo](https://togithub.com/uriyyo)
- Mention Python >= 3.9.2 as an alternative to `typing_extensions.TypedDict`, [#3374](https://togithub.com/pydantic/pydantic/pull/3374) by [@BvB93](https://togithub.com/BvB93)
- Changed the validator method name in the [Custom Errors example](https://docs.pydantic.dev/usage/models/#custom-errors)
to more accurately describe what the validator is doing; changed from `name_must_contain_space` to ` value_must_equal_bar `, [#3327](https://togithub.com/pydantic/pydantic/pull/3327) by [@michaelrios28](https://togithub.com/michaelrios28)
- Add `AmqpDsn` class, [#3254](https://togithub.com/pydantic/pydantic/pull/3254) by [@kludex](https://togithub.com/kludex)
- Always use `Enum` value as default in generated JSON schema, [#3190](https://togithub.com/pydantic/pydantic/pull/3190) by [@joaommartins](https://togithub.com/joaommartins)
- Add support for Mypy 0.920, [#3175](https://togithub.com/pydantic/pydantic/pull/3175) by [@christianbundy](https://togithub.com/christianbundy)
- `validate_arguments` now supports `extra` customization (used to always be `Extra.forbid`), [#3161](https://togithub.com/pydantic/pydantic/pull/3161) by [@PrettyWood](https://togithub.com/PrettyWood)
- Complex types can be set by nested environment variables, [#3159](https://togithub.com/pydantic/pydantic/pull/3159) by [@Air-Mark](https://togithub.com/Air-Mark)
- Fix mypy plugin to collect fields based on `pydantic.utils.is_valid_field` so that it ignores untyped private variables, [#3146](https://togithub.com/pydantic/pydantic/pull/3146) by [@hi-ogawa](https://togithub.com/hi-ogawa)
- fix `validate_arguments` issue with `Config.validate_all`, [#3135](https://togithub.com/pydantic/pydantic/pull/3135) by [@PrettyWood](https://togithub.com/PrettyWood)
- avoid dict coercion when using dict subclasses as field type, [#3122](https://togithub.com/pydantic/pydantic/pull/3122) by [@PrettyWood](https://togithub.com/PrettyWood)
- add support for `object` type, [#3062](https://togithub.com/pydantic/pydantic/pull/3062) by [@PrettyWood](https://togithub.com/PrettyWood)
- Updates pydantic dataclasses to keep `_special` properties on parent classes, [#3043](https://togithub.com/pydantic/pydantic/pull/3043) by [@zulrang](https://togithub.com/zulrang)
- Add a `TypedDict` class for error objects, [#3038](https://togithub.com/pydantic/pydantic/pull/3038) by [@matthewhughes934](https://togithub.com/matthewhughes934)
- Fix support for using a subclass of an annotation as a default, [#3018](https://togithub.com/pydantic/pydantic/pull/3018) by [@JacobHayes](https://togithub.com/JacobHayes)
- make `create_model_from_typeddict` mypy compliant, [#3008](https://togithub.com/pydantic/pydantic/pull/3008) by [@PrettyWood](https://togithub.com/PrettyWood)
- Make multiple inheritance work when using `PrivateAttr`, [#2989](https://togithub.com/pydantic/pydantic/pull/2989) by [@hmvp](https://togithub.com/hmvp)
- Parse environment variables as JSON, if they have a `Union` type with a complex subfield, [#2936](https://togithub.com/pydantic/pydantic/pull/2936) by [@cbartz](https://togithub.com/cbartz)
- Prevent `StrictStr` permitting `Enum` values where the enum inherits from `str`, [#2929](https://togithub.com/pydantic/pydantic/pull/2929) by [@samuelcolvin](https://togithub.com/samuelcolvin)
- Make `SecretsSettingsSource` parse values being assigned to fields of complex types when sourced from a secrets file,
just as when sourced from environment variables, [#2917](https://togithub.com/pydantic/pydantic/pull/2917) by [@davidmreed](https://togithub.com/davidmreed)
- add a dark mode to *pydantic* documentation, [#2913](https://togithub.com/pydantic/pydantic/pull/2913) by [@gbdlin](https://togithub.com/gbdlin)
- Make `pydantic-mypy` plugin compatible with `pyproject.toml` configuration, consistent with `mypy` changes.
See the [doc](https://docs.pydantic.dev/mypy_plugin/#configuring-the-plugin) for more information, [#2908](https://togithub.com/pydantic/pydantic/pull/2908) by [@jrwalk](https://togithub.com/jrwalk)
- add Python 3.10 support, [#2885](https://togithub.com/pydantic/pydantic/pull/2885) by [@PrettyWood](https://togithub.com/PrettyWood)
- Correctly parse generic models with `Json[T]`, [#2860](https://togithub.com/pydantic/pydantic/pull/2860) by [@geekingfrog](https://togithub.com/geekingfrog)
- Update contrib docs re: Python version to use for building docs, [#2856](https://togithub.com/pydantic/pydantic/pull/2856) by [@paxcodes](https://togithub.com/paxcodes)
- Clarify documentation about *pydantic*'s support for custom validation and strict type checking,
despite *pydantic* being primarily a parsing library, [#2855](https://togithub.com/pydantic/pydantic/pull/2855) by [@paxcodes](https://togithub.com/paxcodes)
- Fix schema generation for `Deque` fields, [#2810](https://togithub.com/pydantic/pydantic/pull/2810) by [@sergejkozin](https://togithub.com/sergejkozin)
- fix an edge case when mixing constraints and `Literal`, [#2794](https://togithub.com/pydantic/pydantic/pull/2794) by [@PrettyWood](https://togithub.com/PrettyWood)
- Fix postponed annotation resolution for `NamedTuple` and `TypedDict` when they're used directly as the type of fields
within Pydantic models, [#2760](https://togithub.com/pydantic/pydantic/pull/2760) by [@jameysharp](https://togithub.com/jameysharp)
- Fix bug when `mypy` plugin fails on `construct` method call for `BaseSettings` derived classes, [#2753](https://togithub.com/pydantic/pydantic/pull/2753) by [@uriyyo](https://togithub.com/uriyyo)
- Add function overloading for a `pydantic.create_model` function, [#2748](https://togithub.com/pydantic/pydantic/pull/2748) by [@uriyyo](https://togithub.com/uriyyo)
- Fix mypy plugin issue with self field declaration, [#2743](https://togithub.com/pydantic/pydantic/pull/2743) by [@uriyyo](https://togithub.com/uriyyo)
- The colon at the end of the line "The fields which were supplied when user was initialised:" suggests that the code following it is related.
Changed it to a period, [#2733](https://togithub.com/pydantic/pydantic/pull/2733) by [@krisaoe](https://togithub.com/krisaoe)
- Renamed variable `schema` to `schema_` to avoid shadowing of global variable name, [#2724](https://togithub.com/pydantic/pydantic/pull/2724) by [@shahriyarr](https://togithub.com/shahriyarr)
- Add support for autocomplete in VS Code via `__dataclass_transform__`, [#2721](https://togithub.com/pydantic/pydantic/pull/2721) by [@tiangolo](https://togithub.com/tiangolo)
- add missing type annotations in `BaseConfig` and handle `max_length = 0`, [#2719](https://togithub.com/pydantic/pydantic/pull/2719) by [@PrettyWood](https://togithub.com/PrettyWood)
- Change `orm_mode` checking to allow recursive ORM mode parsing with dicts, [#2718](https://togithub.com/pydantic/pydantic/pull/2718) by [@nuno-andre](https://togithub.com/nuno-andre)
- Add episode 313 of the *Talk Python To Me* podcast, where Michael Kennedy and Samuel Colvin discuss Pydantic, to the docs, [#2712](https://togithub.com/pydantic/pydantic/pull/2712) by [@RatulMaharaj](https://togithub.com/RatulMaharaj)
- fix JSON schema generation when a field is of type `NamedTuple` and has a default value, [#2707](https://togithub.com/pydantic/pydantic/pull/2707) by [@PrettyWood](https://togithub.com/PrettyWood)
- `Enum` fields now properly support extra kwargs in schema generation, [#2697](https://togithub.com/pydantic/pydantic/pull/2697) by [@sammchardy](https://togithub.com/sammchardy)
- **Breaking Change, see [#3780](https://togithub.com/pydantic/pydantic/pull/3780)**: Make serialization of referenced pydantic models possible, [#2650](https://togithub.com/pydantic/pydantic/pull/2650) by [@PrettyWood](https://togithub.com/PrettyWood)
- Add `uniqueItems` option to `ConstrainedList`, [#2618](https://togithub.com/pydantic/pydantic/pull/2618) by [@nuno-andre](https://togithub.com/nuno-andre)
- Try to evaluate forward refs automatically at model creation, [#2588](https://togithub.com/pydantic/pydantic/pull/2588) by [@uriyyo](https://togithub.com/uriyyo)
- Switch docs preview and coverage display to use [smokeshow](https://smokeshow.helpmanual.io/), [#2580](https://togithub.com/pydantic/pydantic/pull/2580) by [@samuelcolvin](https://togithub.com/samuelcolvin)
- Add `__version__` attribute to pydantic module, [#2572](https://togithub.com/pydantic/pydantic/pull/2572) by [@paxcodes](https://togithub.com/paxcodes)
- Add `postgresql+asyncpg`, `postgresql+pg8000`, `postgresql+psycopg2`, `postgresql+psycopg2cffi`, `postgresql+py-postgresql`
and `postgresql+pygresql` schemes for `PostgresDsn`, [#2567](https://togithub.com/pydantic/pydantic/pull/2567) by [@postgres-asyncpg](https://togithub.com/postgres-asyncpg)
- Enable the Hypothesis plugin to generate a constrained decimal when the `decimal_places` argument is specified, [#2524](https://togithub.com/pydantic/pydantic/pull/2524) by [@cwe5590](https://togithub.com/cwe5590)
- Allow `collections.abc.Callable` to be used as type in Python 3.9, [#2519](https://togithub.com/pydantic/pydantic/pull/2519) by [@daviskirk](https://togithub.com/daviskirk)
- Documentation update how to custom compile pydantic when using pip install, small change in `setup.py`
to allow for custom CFLAGS when compiling, [#2517](https://togithub.com/pydantic/pydantic/pull/2517) by [@peterroelants](https://togithub.com/peterroelants)
- remove side effect of `default_factory` to run it only once even if `Config.validate_all` is set, [#2515](https://togithub.com/pydantic/pydantic/pull/2515) by [@PrettyWood](https://togithub.com/PrettyWood)
- Add lookahead to ip regexes for `AnyUrl` hosts. This allows urls with DNS labels
looking like IPs to validate as they are perfectly valid host names, [#2512](https://togithub.com/pydantic/pydantic/pull/2512) by [@sbv-csis](https://togithub.com/sbv-csis)
- Set `minItems` and `maxItems` in generated JSON schema for fixed-length tuples, [#2497](https://togithub.com/pydantic/pydantic/pull/2497) by [@PrettyWood](https://togithub.com/PrettyWood)
- Add `strict` argument to `conbytes`, [#2489](https://togithub.com/pydantic/pydantic/pull/2489) by [@koxudaxi](https://togithub.com/koxudaxi)
- Support user defined generic field types in generic models, [#2465](https://togithub.com/pydantic/pydantic/pull/2465) by [@daviskirk](https://togithub.com/daviskirk)
- Add an example and a short explanation of subclassing `GetterDict` to docs, [#2463](https://togithub.com/pydantic/pydantic/pull/2463) by [@nuno-andre](https://togithub.com/nuno-andre)
- add `KafkaDsn` type, `HttpUrl` now has default port 80 for http and 443 for https, [#2447](https://togithub.com/pydantic/pydantic/pull/2447) by [@MihanixA](https://togithub.com/MihanixA)
- Add `PastDate` and `FutureDate` types, [#2425](https://togithub.com/pydantic/pydantic/pull/2425) by [@Kludex](https://togithub.com/Kludex)
- Support generating schema for `Generic` fields with subtypes, [#2375](https://togithub.com/pydantic/pydantic/pull/2375) by [@maximberg](https://togithub.com/maximberg)
- fix(encoder): serialize `NameEmail` to str, [#2341](https://togithub.com/pydantic/pydantic/pull/2341) by [@alecgerona](https://togithub.com/alecgerona)
- add `Config.smart_union` to prevent coercion in `Union` if possible, see
[the doc](https://docs.pydantic.dev/usage/model_config/#smart-union) for more information, [#2092](https://togithub.com/pydantic/pydantic/pull/2092) by [@PrettyWood](https://togithub.com/PrettyWood)
- Add ability to use `typing.Counter` as a model field type, [#2060](https://togithub.com/pydantic/pydantic/pull/2060) by [@uriyyo](https://togithub.com/uriyyo)
- Add parameterised subclasses to `__bases__` when constructing new parameterised classes, so that `A <: B => A[int] <: B[int]`, [#2007](https://togithub.com/pydantic/pydantic/pull/2007) by [@diabolo-dan](https://togithub.com/diabolo-dan)
- Create `FileUrl` type that allows URLs that conform to [RFC 8089](https://tools.ietf.org/html/rfc8089#section-2).
Add `host_required` parameter, which is `True` by default (`AnyUrl` and subclasses), `False` in `RedisDsn`, `FileUrl`, [#1983](https://togithub.com/pydantic/pydantic/pull/1983) by [@vgerak](https://togithub.com/vgerak)
- add `confrozenset()`, analogous to `conset()` and `conlist()`, [#1897](https://togithub.com/pydantic/pydantic/pull/1897) by [@PrettyWood](https://togithub.com/PrettyWood)
- stop calling parent class `root_validator` if overridden, [#1895](https://togithub.com/pydantic/pydantic/pull/1895) by [@PrettyWood](https://togithub.com/PrettyWood)
- Add `repr` (defaults to `True`) parameter to `Field`, to hide it from the default representation of the `BaseModel`, [#1831](https://togithub.com/pydantic/pydantic/pull/1831) by [@fnep](https://togithub.com/fnep)
- Accept empty query/fragment URL parts, [#1807](https://togithub.com/pydantic/pydantic/pull/1807) by [@xavier](https://togithub.com/xavier)
### [`v1.8.2`](https://togithub.com/pydantic/pydantic/blob/HEAD/HISTORY.md#v182-2021-05-11)
[Compare Source](https://togithub.com/pydantic/pydantic/compare/v1.8.1...v1.8.2)
!!! warning
A security vulnerability, level "moderate" is fixed in v1.8.2. Please upgrade **ASAP**.
See security advisory [CVE-2021-29510](https://togithub.com/pydantic/pydantic/security/advisories/GHSA-5jqp-qgf6-3pvh)
- **Security fix:** Fix `date` and `datetime` parsing so passing either `'infinity'` or `float('inf')`
(or their negative values) does not cause an infinite loop,
see security advisory [CVE-2021-29510](https://togithub.com/pydantic/pydantic/security/advisories/GHSA-5jqp-qgf6-3pvh)
- fix schema generation with Enum by generating a valid name, [#2575](https://togithub.com/pydantic/pydantic/pull/2575) by [@PrettyWood](https://togithub.com/PrettyWood)
- fix JSON schema generation with a `Literal` of an enum member, [#2536](https://togithub.com/pydantic/pydantic/pull/2536) by [@PrettyWood](https://togithub.com/PrettyWood)
- Fix bug with configurations declarations that are passed as
keyword arguments during class creation, [#2532](https://togithub.com/pydantic/pydantic/pull/2532) by [@uriyyo](https://togithub.com/uriyyo)
- Allow passing `json_encoders` in class kwargs, [#2521](https://togithub.com/pydantic/pydantic/pull/2521) by [@layday](https://togithub.com/layday)
- support arbitrary types with custom `__eq__`, [#2483](https://togithub.com/pydantic/pydantic/pull/2483) by [@PrettyWood](https://togithub.com/PrettyWood)
- support `Annotated` in `validate_arguments` and in generic models with Python 3.9, [#2483](https://togithub.com/pydantic/pydantic/pull/2483) by [@PrettyWood](https://togithub.com/PrettyWood)
### [`v1.8.1`](https://togithub.com/pydantic/pydantic/blob/HEAD/HISTORY.md#v181-2021-03-03)
[Compare Source](https://togithub.com/pydantic/pydantic/compare/v1.8...v1.8.1)
Bug fixes for regressions and new features from `v1.8`
- allow elements of `Config.field` to update elements of a `Field`, [#2461](https://togithub.com/pydantic/pydantic/pull/2461) by [@samuelcolvin](https://togithub.com/samuelcolvin)
- fix validation with a `BaseModel` field and a custom root type, [#2449](https://togithub.com/pydantic/pydantic/pull/2449) by [@PrettyWood](https://togithub.com/PrettyWood)
- expose `Pattern` encoder to `fastapi`, [#2444](https://togithub.com/pydantic/pydantic/pull/2444) by [@PrettyWood](https://togithub.com/PrettyWood)
- enable the Hypothesis plugin to generate a constrained float when the `multiple_of` argument is specified, [#2442](https://togithub.com/pydantic/pyda
Configuration
📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
[ ] If you want to rebase/retry this PR, check this box
This PR contains the following updates:
<=1.10.9
-><=1.10.13
GitHub Vulnerability Alerts
CVE-2024-3772
Regular expression denial of service in Pydantic < 2.4.0, < 1.10.13 allows remote attackers to cause denial of service via a crafted email string.
Release Notes
pydantic/pydantic (pydantic)
### [`v1.10.13`](https://togithub.com/pydantic/pydantic/blob/HEAD/HISTORY.md#v11013-2023-09-27) [Compare Source](https://togithub.com/pydantic/pydantic/compare/v1.10.12...v1.10.13) - Fix: Add max length check to `pydantic.validate_email`, [#7673](https://togithub.com/pydantic/pydantic/issues/7673) by [@hramezani](https://togithub.com/hramezani) - Docs: Fix pip commands to install v1, [#6930](https://togithub.com/pydantic/pydantic/issues/6930) by [@chbndrhnns](https://togithub.com/chbndrhnns) ### [`v1.10.12`](https://togithub.com/pydantic/pydantic/blob/HEAD/HISTORY.md#v11012-2023-07-24) [Compare Source](https://togithub.com/pydantic/pydantic/compare/v1.10.11...v1.10.12) - Fixes the `maxlen` property being dropped on `deque` validation. Happened only if the deque item has been typed. Changes the `_validate_sequence_like` func, [#6581](https://togithub.com/pydantic/pydantic/pull/6581) by [@maciekglowka](https://togithub.com/maciekglowka) ### [`v1.10.11`](https://togithub.com/pydantic/pydantic/blob/HEAD/HISTORY.md#v11011-2023-07-04) [Compare Source](https://togithub.com/pydantic/pydantic/compare/v1.10.10...v1.10.11) - Importing create_model in tools.py through relative path instead of absolute path - so that it doesn't import V2 code when copied over to V2 branch, [#6361](https://togithub.com/pydantic/pydantic/pull/6361) by [@SharathHuddar](https://togithub.com/SharathHuddar) ### [`v1.10.10`](https://togithub.com/pydantic/pydantic/blob/HEAD/HISTORY.md#v11010-2023-06-30) [Compare Source](https://togithub.com/pydantic/pydantic/compare/v1.10.9...v1.10.10) - Add Pydantic `Json` field support to settings management, [#6250](https://togithub.com/pydantic/pydantic/pull/6250) by [@hramezani](https://togithub.com/hramezani) - Fixed literal validator errors for unhashable values, [#6188](https://togithub.com/pydantic/pydantic/pull/6188) by [@markus1978](https://togithub.com/markus1978) - Fixed bug with generics receiving forward refs, [#6130](https://togithub.com/pydantic/pydantic/pull/6130) by [@mark-todd](https://togithub.com/mark-todd) - Update install method of FastAPI for internal tests in CI, [#6117](https://togithub.com/pydantic/pydantic/pull/6117) by [@Kludex](https://togithub.com/Kludex) ### [`v1.10.9`](https://togithub.com/pydantic/pydantic/blob/HEAD/HISTORY.md#v1109-2023-06-07) [Compare Source](https://togithub.com/pydantic/pydantic/compare/v1.10.8...v1.10.9) - Fix trailing zeros not ignored in Decimal validation, [#5968](https://togithub.com/pydantic/pydantic/pull/5968) by [@hramezani](https://togithub.com/hramezani) - Fix mypy plugin for v1.4.0, [#5928](https://togithub.com/pydantic/pydantic/pull/5928) by [@cdce8p](https://togithub.com/cdce8p) - Add future and past date hypothesis strategies, [#5850](https://togithub.com/pydantic/pydantic/pull/5850) by [@bschoenmaeckers](https://togithub.com/bschoenmaeckers) - Discourage usage of Cython 3 with Pydantic 1.x, [#5845](https://togithub.com/pydantic/pydantic/pull/5845) by [@lig](https://togithub.com/lig) ### [`v1.10.8`](https://togithub.com/pydantic/pydantic/blob/HEAD/HISTORY.md#v1108-2023-05-23) [Compare Source](https://togithub.com/pydantic/pydantic/compare/v1.10.7...v1.10.8) - Fix a bug in `Literal` usage with `typing-extension==4.6.0`, [#5826](https://togithub.com/pydantic/pydantic/pull/5826) by [@hramezani](https://togithub.com/hramezani) - This solves the (closed) issue [#3849](https://togithub.com/pydantic/pydantic/pull/3849) where aliased fields that use discriminated union fail to validate when the data contains the non-aliased field name, [#5736](https://togithub.com/pydantic/pydantic/pull/5736) by [@benwah](https://togithub.com/benwah) - Update email-validator dependency to >=2.0.0post2, [#5627](https://togithub.com/pydantic/pydantic/pull/5627) by [@adriangb](https://togithub.com/adriangb) - update `AnyClassMethod` for changes in [python/typeshed#9771](https://togithub.com/python/typeshed/issues/9771), [#5505](https://togithub.com/pydantic/pydantic/pull/5505) by [@ITProKyle](https://togithub.com/ITProKyle) ### [`v1.10.7`](https://togithub.com/pydantic/pydantic/blob/HEAD/HISTORY.md#v1107-2023-03-22) [Compare Source](https://togithub.com/pydantic/pydantic/compare/v1.10.6...v1.10.7) - Fix creating schema from model using `ConstrainedStr` with `regex` as dict key, [#5223](https://togithub.com/pydantic/pydantic/pull/5223) by [@matejetz](https://togithub.com/matejetz) - Address bug in mypy plugin caused by explicit_package_bases=True, [#5191](https://togithub.com/pydantic/pydantic/pull/5191) by [@dmontagu](https://togithub.com/dmontagu) - Add implicit defaults in the mypy plugin for Field with no default argument, [#5190](https://togithub.com/pydantic/pydantic/pull/5190) by [@dmontagu](https://togithub.com/dmontagu) - Fix schema generated for Enum values used as Literals in discriminated unions, [#5188](https://togithub.com/pydantic/pydantic/pull/5188) by [@javibookline](https://togithub.com/javibookline) - Fix mypy failures caused by the pydantic mypy plugin when users define `from_orm` in their own classes, [#5187](https://togithub.com/pydantic/pydantic/pull/5187) by [@dmontagu](https://togithub.com/dmontagu) - Fix `InitVar` usage with pydantic dataclasses, mypy version `1.1.1` and the custom mypy plugin, [#5162](https://togithub.com/pydantic/pydantic/pull/5162) by [@cdce8p](https://togithub.com/cdce8p) ### [`v1.10.6`](https://togithub.com/pydantic/pydantic/blob/HEAD/HISTORY.md#v1106-2023-03-08) [Compare Source](https://togithub.com/pydantic/pydantic/compare/v1.10.5...v1.10.6) - Implement logic to support creating validators from non standard callables by using defaults to identify them and unwrapping `functools.partial` and `functools.partialmethod` when checking the signature, [#5126](https://togithub.com/pydantic/pydantic/pull/5126) by [@JensHeinrich](https://togithub.com/JensHeinrich) - Fix mypy plugin for v1.1.1, and fix `dataclass_transform` decorator for pydantic dataclasses, [#5111](https://togithub.com/pydantic/pydantic/pull/5111) by [@cdce8p](https://togithub.com/cdce8p) - Raise `ValidationError`, not `ConfigError`, when a discriminator value is unhashable, [#4773](https://togithub.com/pydantic/pydantic/pull/4773) by [@kurtmckee](https://togithub.com/kurtmckee) ### [`v1.10.5`](https://togithub.com/pydantic/pydantic/blob/HEAD/HISTORY.md#v1105-2023-02-15) [Compare Source](https://togithub.com/pydantic/pydantic/compare/v1.10.4...v1.10.5) - Fix broken parametrized bases handling with `GenericModel`s with complex sets of models, [#5052](https://togithub.com/pydantic/pydantic/pull/5052) by [@MarkusSintonen](https://togithub.com/MarkusSintonen) - Invalidate mypy cache if plugin config changes, [#5007](https://togithub.com/pydantic/pydantic/pull/5007) by [@cdce8p](https://togithub.com/cdce8p) - Fix `RecursionError` when deep-copying dataclass types wrapped by pydantic, [#4949](https://togithub.com/pydantic/pydantic/pull/4949) by [@mbillingr](https://togithub.com/mbillingr) - Fix `X | Y` union syntax breaking `GenericModel`, [#4146](https://togithub.com/pydantic/pydantic/pull/4146) by [@thenx](https://togithub.com/thenx) - Switch coverage badge to show coverage for this branch/release, [#5060](https://togithub.com/pydantic/pydantic/pull/5060) by [@samuelcolvin](https://togithub.com/samuelcolvin) ### [`v1.10.4`](https://togithub.com/pydantic/pydantic/blob/HEAD/HISTORY.md#v1104-2022-12-30) [Compare Source](https://togithub.com/pydantic/pydantic/compare/v1.10.3...v1.10.4) - Change dependency to `typing-extensions>=4.2.0`, [#4885](https://togithub.com/pydantic/pydantic/pull/4885) by [@samuelcolvin](https://togithub.com/samuelcolvin) ### [`v1.10.3`](https://togithub.com/pydantic/pydantic/blob/HEAD/HISTORY.md#v1103-2022-12-29) [Compare Source](https://togithub.com/pydantic/pydantic/compare/v1.10.2...v1.10.3) **NOTE: v1.10.3 was ["yanked"](https://pypi.org/help/#yanked) from PyPI due to [#4885](https://togithub.com/pydantic/pydantic/pull/4885) which is fixed in v1.10.4** - fix parsing of custom root models, [#4883](https://togithub.com/pydantic/pydantic/pull/4883) by [@gou177](https://togithub.com/gou177) - fix: use dataclass proxy for frozen or empty dataclasses, [#4878](https://togithub.com/pydantic/pydantic/pull/4878) by [@PrettyWood](https://togithub.com/PrettyWood) - Fix `schema` and `schema_json` on models where a model instance is a one of default values, [#4781](https://togithub.com/pydantic/pydantic/pull/4781) by [@Bobronium](https://togithub.com/Bobronium) - Add Jina AI to sponsors on docs index page, [#4767](https://togithub.com/pydantic/pydantic/pull/4767) by [@samuelcolvin](https://togithub.com/samuelcolvin) - fix: support assignment on `DataclassProxy`, [#4695](https://togithub.com/pydantic/pydantic/pull/4695) by [@PrettyWood](https://togithub.com/PrettyWood) - Add `postgresql+psycopg` as allowed scheme for `PostgreDsn` to make it usable with SQLAlchemy 2, [#4689](https://togithub.com/pydantic/pydantic/pull/4689) by [@morian](https://togithub.com/morian) - Allow dict schemas to have both `patternProperties` and `additionalProperties`, [#4641](https://togithub.com/pydantic/pydantic/pull/4641) by [@jparise](https://togithub.com/jparise) - Fixes error passing None for optional lists with `unique_items`, [#4568](https://togithub.com/pydantic/pydantic/pull/4568) by [@mfulgo](https://togithub.com/mfulgo) - Fix `GenericModel` with `Callable` param raising a `TypeError`, [#4551](https://togithub.com/pydantic/pydantic/pull/4551) by [@mfulgo](https://togithub.com/mfulgo) - Fix field regex with `StrictStr` type annotation, [#4538](https://togithub.com/pydantic/pydantic/pull/4538) by [@sisp](https://togithub.com/sisp) - Correct `dataclass_transform` keyword argument name from `field_descriptors` to `field_specifiers`, [#4500](https://togithub.com/pydantic/pydantic/pull/4500) by [@samuelcolvin](https://togithub.com/samuelcolvin) - fix: avoid multiple calls of `__post_init__` when dataclasses are inherited, [#4487](https://togithub.com/pydantic/pydantic/pull/4487) by [@PrettyWood](https://togithub.com/PrettyWood) - Reduce the size of binary wheels, [#2276](https://togithub.com/pydantic/pydantic/pull/2276) by [@samuelcolvin](https://togithub.com/samuelcolvin) ### [`v1.10.2`](https://togithub.com/pydantic/pydantic/blob/HEAD/HISTORY.md#v1102-2022-09-05) [Compare Source](https://togithub.com/pydantic/pydantic/compare/v1.10.1...v1.10.2) - **Revert Change:** Revert percent encoding of URL parts which was originally added in [#4224](https://togithub.com/pydantic/pydantic/pull/4224), [#4470](https://togithub.com/pydantic/pydantic/pull/4470) by [@samuelcolvin](https://togithub.com/samuelcolvin) - Prevent long (length > `4_300`) strings/bytes as input to int fields, see [python/cpython#95778](https://togithub.com/python/cpython/issues/95778) and [CVE-2020-10735](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-10735), [#1477](https://togithub.com/pydantic/pydantic/pull/1477) by [@samuelcolvin](https://togithub.com/samuelcolvin) - fix: dataclass wrapper was not always called, [#4477](https://togithub.com/pydantic/pydantic/pull/4477) by [@PrettyWood](https://togithub.com/PrettyWood) - Use `tomllib` on Python 3.11 when parsing `mypy` configuration, [#4476](https://togithub.com/pydantic/pydantic/pull/4476) by [@hauntsaninja](https://togithub.com/hauntsaninja) - Basic fix of `GenericModel` cache to detect order of arguments in `Union` models, [#4474](https://togithub.com/pydantic/pydantic/pull/4474) by [@sveinugu](https://togithub.com/sveinugu) - Fix mypy plugin when using bare types like `list` and `dict` as `default_factory`, [#4457](https://togithub.com/pydantic/pydantic/pull/4457) by [@samuelcolvin](https://togithub.com/samuelcolvin) ### [`v1.10.1`](https://togithub.com/pydantic/pydantic/blob/HEAD/HISTORY.md#v11018-2024-08-22) [Compare Source](https://togithub.com/pydantic/pydantic/compare/v1.10.0...v1.10.1) - Eval type fix in V1 by [@sydney-runkle](https://togithub.com/sydney-runkle) in [https://github.com/pydantic/pydantic/pull/9751](https://togithub.com/pydantic/pydantic/pull/9751) - Add `to_lower_camel` to `__all__` in `utils.py` by [@sydney-runkle](https://togithub.com/sydney-runkle) (direct commit) - Fix `mypy` v1 plugin for mypy 1.11 release by [@flaeppe](https://togithub.com/flaeppe) in [https://github.com/pydantic/pydantic/pull/10139](https://togithub.com/pydantic/pydantic/pull/10139) - Fix discriminator key used when discriminator has alias and `.schema(by_alias=False)` by [@exs-dwoodward](https://togithub.com/exs-dwoodward) in [https://github.com/pydantic/pydantic/pull/10146](https://togithub.com/pydantic/pydantic/pull/10146) ### [`v1.10.0`](https://togithub.com/pydantic/pydantic/blob/HEAD/HISTORY.md#v1100-2022-08-30) [Compare Source](https://togithub.com/pydantic/pydantic/compare/v1.9.2...v1.10.0) - Refactor the whole *pydantic* `dataclass` decorator to really act like its standard lib equivalent. It hence keeps `__eq__`, `__hash__`, ... and makes comparison with its non-validated version possible. It also fixes usage of `frozen` dataclasses in fields and usage of `default_factory` in nested dataclasses. The support of `Config.extra` has been added. Finally, config customization directly via a `dict` is now possible, [#2557](https://togithub.com/pydantic/pydantic/pull/2557) by [@PrettyWood](https://togithub.com/PrettyWood)**BREAKING CHANGES:** - The `compiled` boolean (whether *pydantic* is compiled with cython) has been moved from `main.py` to `version.py` - Now that `Config.extra` is supported, `dataclass` ignores by default extra arguments (like `BaseModel`) - Fix PEP487 `__set_name__` protocol in `BaseModel` for PrivateAttrs, [#4407](https://togithub.com/pydantic/pydantic/pull/4407) by [@tlambert03](https://togithub.com/tlambert03) - Allow for custom parsing of environment variables via `parse_env_var` in `Config`, [#4406](https://togithub.com/pydantic/pydantic/pull/4406) by [@acmiyaguchi](https://togithub.com/acmiyaguchi) - Rename `master` to `main`, [#4405](https://togithub.com/pydantic/pydantic/pull/4405) by [@hramezani](https://togithub.com/hramezani) - Fix `StrictStr` does not raise `ValidationError` when `max_length` is present in `Field`, [#4388](https://togithub.com/pydantic/pydantic/pull/4388) by [@hramezani](https://togithub.com/hramezani) - Make `SecretStr` and `SecretBytes` hashable, [#4387](https://togithub.com/pydantic/pydantic/pull/4387) by [@chbndrhnns](https://togithub.com/chbndrhnns) - Fix `StrictBytes` does not raise `ValidationError` when `max_length` is present in `Field`, [#4380](https://togithub.com/pydantic/pydantic/pull/4380) by [@JeanArhancet](https://togithub.com/JeanArhancet) - Add support for bare `type`, [#4375](https://togithub.com/pydantic/pydantic/pull/4375) by [@hramezani](https://togithub.com/hramezani) - Support Python 3.11, including binaries for 3.11 in PyPI, [#4374](https://togithub.com/pydantic/pydantic/pull/4374) by [@samuelcolvin](https://togithub.com/samuelcolvin) - Add support for `re.Pattern`, [#4366](https://togithub.com/pydantic/pydantic/pull/4366) by [@hramezani](https://togithub.com/hramezani) - Fix `__post_init_post_parse__` is incorrectly passed keyword arguments when no `__post_init__` is defined, [#4361](https://togithub.com/pydantic/pydantic/pull/4361) by [@hramezani](https://togithub.com/hramezani) - Fix implicitly importing `ForwardRef` and `Callable` from `pydantic.typing` instead of `typing` and also expose `MappingIntStrAny`, [#4358](https://togithub.com/pydantic/pydantic/pull/4358) by [@aminalaee](https://togithub.com/aminalaee) - remove `Any` types from the `dataclass` decorator so it can be used with the `disallow_any_expr` mypy option, [#4356](https://togithub.com/pydantic/pydantic/pull/4356) by [@DetachHead](https://togithub.com/DetachHead) - moved repo to `pydantic/pydantic`, [#4348](https://togithub.com/pydantic/pydantic/pull/4348) by [@yezz123](https://togithub.com/yezz123) - fix "extra fields not permitted" error when dataclass with `Extra.forbid` is validated multiple times, [#4343](https://togithub.com/pydantic/pydantic/pull/4343) by [@detachhead](https://togithub.com/detachhead) - Add Python 3.9 and 3.10 examples to docs, [#4339](https://togithub.com/pydantic/pydantic/pull/4339) by [@Bobronium](https://togithub.com/Bobronium) - Discriminated union models now use `oneOf` instead of `anyOf` when generating OpenAPI schema definitions, [#4335](https://togithub.com/pydantic/pydantic/pull/4335) by [@MaxwellPayne](https://togithub.com/MaxwellPayne) - Allow type checkers to infer inner type of `Json` type. `Json[list[str]]` will be now inferred as `list[str]`, `Json[Any]` should be used instead of plain `Json`. Runtime behaviour is not changed, [#4332](https://togithub.com/pydantic/pydantic/pull/4332) by [@Bobronium](https://togithub.com/Bobronium) - Allow empty string aliases by using a `alias is not None` check, rather than `bool(alias)`, [#4253](https://togithub.com/pydantic/pydantic/pull/4253) by [@sergeytsaplin](https://togithub.com/sergeytsaplin) - Update `ForwardRef`s in `Field.outer_type_`, [#4249](https://togithub.com/pydantic/pydantic/pull/4249) by [@JacobHayes](https://togithub.com/JacobHayes) - The use of `__dataclass_transform__` has been replaced by `typing_extensions.dataclass_transform`, which is the preferred way to mark pydantic models as a dataclass under [PEP 681](https://peps.python.org/pep-0681/), [#4241](https://togithub.com/pydantic/pydantic/pull/4241) by [@multimeric](https://togithub.com/multimeric) - Use parent model's `Config` when validating nested `NamedTuple` fields, [#4219](https://togithub.com/pydantic/pydantic/pull/4219) by [@synek](https://togithub.com/synek) - Update `BaseModel.construct` to work with aliased Fields, [#4192](https://togithub.com/pydantic/pydantic/pull/4192) by [@kylebamos](https://togithub.com/kylebamos) - Catch certain raised errors in `smart_deepcopy` and revert to `deepcopy` if so, [#4184](https://togithub.com/pydantic/pydantic/pull/4184) by [@coneybeare](https://togithub.com/coneybeare) - Add `Config.anystr_upper` and `to_upper` kwarg to constr and conbytes, [#4165](https://togithub.com/pydantic/pydantic/pull/4165) by [@satheler](https://togithub.com/satheler) - Fix JSON schema for `set` and `frozenset` when they include default values, [#4155](https://togithub.com/pydantic/pydantic/pull/4155) by [@aminalaee](https://togithub.com/aminalaee) - Teach the mypy plugin that methods decorated by `@validator` are classmethods, [#4102](https://togithub.com/pydantic/pydantic/pull/4102) by [@DMRobertson](https://togithub.com/DMRobertson) - Improve mypy plugin's ability to detect required fields, [#4086](https://togithub.com/pydantic/pydantic/pull/4086) by [@richardxia](https://togithub.com/richardxia) - Support fields of type `Type[]` in schema, [#4051](https://togithub.com/pydantic/pydantic/pull/4051) by [@aminalaee](https://togithub.com/aminalaee) - Add `default` value in JSON Schema when `const=True`, [#4031](https://togithub.com/pydantic/pydantic/pull/4031) by [@aminalaee](https://togithub.com/aminalaee) - Adds reserved word check to signature generation logic, [#4011](https://togithub.com/pydantic/pydantic/pull/4011) by [@strue36](https://togithub.com/strue36) - Fix Json strategy failure for the complex nested field, [#4005](https://togithub.com/pydantic/pydantic/pull/4005) by [@sergiosim](https://togithub.com/sergiosim) - Add JSON-compatible float constraint `allow_inf_nan`, [#3994](https://togithub.com/pydantic/pydantic/pull/3994) by [@tiangolo](https://togithub.com/tiangolo) - Remove undefined behaviour when `env_prefix` had characters in common with `env_nested_delimiter`, [#3975](https://togithub.com/pydantic/pydantic/pull/3975) by [@arsenron](https://togithub.com/arsenron) - Support generics model with `create_model`, [#3945](https://togithub.com/pydantic/pydantic/pull/3945) by [@hot123s](https://togithub.com/hot123s) - allow submodels to overwrite extra field info, [#3934](https://togithub.com/pydantic/pydantic/pull/3934) by [@PrettyWood](https://togithub.com/PrettyWood) - Document and test structural pattern matching ([PEP 636](https://peps.python.org/pep-0636/)) on `BaseModel`, [#3920](https://togithub.com/pydantic/pydantic/pull/3920) by [@irgolic](https://togithub.com/irgolic) - Fix incorrect deserialization of python timedelta object to ISO 8601 for negative time deltas. Minus was serialized in incorrect place ("P-1DT23H59M59.888735S" instead of correct "-P1DT23H59M59.888735S"), [#3899](https://togithub.com/pydantic/pydantic/pull/3899) by [@07pepa](https://togithub.com/07pepa) - Fix validation of discriminated union fields with an alias when passing a model instance, [#3846](https://togithub.com/pydantic/pydantic/pull/3846) by [@chornsby](https://togithub.com/chornsby) - Add a CockroachDsn type to validate CockroachDB connection strings. The type supports the following schemes: `cockroachdb`, `cockroachdb+psycopg2` and `cockroachdb+asyncpg`, [#3839](https://togithub.com/pydantic/pydantic/pull/3839) by [@blubber](https://togithub.com/blubber) - Fix MyPy plugin to not override pre-existing `__init__` method in models, [#3824](https://togithub.com/pydantic/pydantic/pull/3824) by [@patrick91](https://togithub.com/patrick91) - Fix mypy version checking, [#3783](https://togithub.com/pydantic/pydantic/pull/3783) by [@KotlinIsland](https://togithub.com/KotlinIsland) - support overwriting dunder attributes of `BaseModel` instances, [#3777](https://togithub.com/pydantic/pydantic/pull/3777) by [@PrettyWood](https://togithub.com/PrettyWood) - Added `ConstrainedDate` and `condate`, [#3740](https://togithub.com/pydantic/pydantic/pull/3740) by [@hottwaj](https://togithub.com/hottwaj) - Support `kw_only` in dataclasses, [#3670](https://togithub.com/pydantic/pydantic/pull/3670) by [@detachhead](https://togithub.com/detachhead) - Add comparison method for `Color` class, [#3646](https://togithub.com/pydantic/pydantic/pull/3646) by [@aminalaee](https://togithub.com/aminalaee) - Drop support for python3.6, associated cleanup, [#3605](https://togithub.com/pydantic/pydantic/pull/3605) by [@samuelcolvin](https://togithub.com/samuelcolvin) - created new function `to_lower_camel()` for "non pascal case" camel case, [#3463](https://togithub.com/pydantic/pydantic/pull/3463) by [@schlerp](https://togithub.com/schlerp) - Add checks to `default` and `default_factory` arguments in Mypy plugin, [#3430](https://togithub.com/pydantic/pydantic/pull/3430) by [@klaa97](https://togithub.com/klaa97) - fix mangling of `inspect.signature` for `BaseModel`, [#3413](https://togithub.com/pydantic/pydantic/pull/3413) by [@fix-inspect-signature](https://togithub.com/fix-inspect-signature) - Adds the `SecretField` abstract class so that all the current and future secret fields like `SecretStr` and `SecretBytes` will derive from it, [#3409](https://togithub.com/pydantic/pydantic/pull/3409) by [@expobrain](https://togithub.com/expobrain) - Support multi hosts validation in `PostgresDsn`, [#3337](https://togithub.com/pydantic/pydantic/pull/3337) by [@rglsk](https://togithub.com/rglsk) - Fix parsing of very small numeric timedelta values, [#3315](https://togithub.com/pydantic/pydantic/pull/3315) by [@samuelcolvin](https://togithub.com/samuelcolvin) - Update `SecretsSettingsSource` to respect `config.case_sensitive`, [#3273](https://togithub.com/pydantic/pydantic/pull/3273) by [@JeanArhancet](https://togithub.com/JeanArhancet) - Add MongoDB network data source name (DSN) schema, [#3229](https://togithub.com/pydantic/pydantic/pull/3229) by [@snosratiershad](https://togithub.com/snosratiershad) - Add support for multiple dotenv files, [#3222](https://togithub.com/pydantic/pydantic/pull/3222) by [@rekyungmin](https://togithub.com/rekyungmin) - Raise an explicit `ConfigError` when multiple fields are incorrectly set for a single validator, [#3215](https://togithub.com/pydantic/pydantic/pull/3215) by [@SunsetOrange](https://togithub.com/SunsetOrange) - Allow ellipsis on `Field`s inside `Annotated` for `TypedDicts` required, [#3133](https://togithub.com/pydantic/pydantic/pull/3133) by [@ezegomez](https://togithub.com/ezegomez) - Catch overflow errors in `int_validator`, [#3112](https://togithub.com/pydantic/pydantic/pull/3112) by [@ojii](https://togithub.com/ojii) - Adds a `__rich_repr__` method to `Representation` class which enables pretty printing with [Rich](https://togithub.com/willmcgugan/rich), [#3099](https://togithub.com/pydantic/pydantic/pull/3099) by [@willmcgugan](https://togithub.com/willmcgugan) - Add percent encoding in `AnyUrl` and descendent types, [#3061](https://togithub.com/pydantic/pydantic/pull/3061) by [@FaresAhmedb](https://togithub.com/FaresAhmedb) - `validate_arguments` decorator now supports `alias`, [#3019](https://togithub.com/pydantic/pydantic/pull/3019) by [@MAD-py](https://togithub.com/MAD-py) - Avoid `__dict__` and `__weakref__` attributes in `AnyUrl` and IP address fields, [#2890](https://togithub.com/pydantic/pydantic/pull/2890) by [@nuno-andre](https://togithub.com/nuno-andre) - Add ability to use `Final` in a field type annotation, [#2766](https://togithub.com/pydantic/pydantic/pull/2766) by [@uriyyo](https://togithub.com/uriyyo) - Update requirement to `typing_extensions>=4.1.0` to guarantee `dataclass_transform` is available, [#4424](https://togithub.com/pydantic/pydantic/pull/4424) by [@commonism](https://togithub.com/commonism) - Add Explosion and AWS to main sponsors, [#4413](https://togithub.com/pydantic/pydantic/pull/4413) by [@samuelcolvin](https://togithub.com/samuelcolvin) - Update documentation for `copy_on_model_validation` to reflect recent changes, [#4369](https://togithub.com/pydantic/pydantic/pull/4369) by [@samuelcolvin](https://togithub.com/samuelcolvin) - Runtime warning if `__slots__` is passed to `create_model`, `__slots__` is then ignored, [#4432](https://togithub.com/pydantic/pydantic/pull/4432) by [@samuelcolvin](https://togithub.com/samuelcolvin) - Add type hints to `BaseSettings.Config` to avoid mypy errors, also correct mypy version compatibility notice in docs, [#4450](https://togithub.com/pydantic/pydantic/pull/4450) by [@samuelcolvin](https://togithub.com/samuelcolvin) ### [`v1.9.2`](https://togithub.com/pydantic/pydantic/blob/HEAD/HISTORY.md#v192-2022-08-11) [Compare Source](https://togithub.com/pydantic/pydantic/compare/v1.9.1...v1.9.2) **Revert Breaking Change**: *v1.9.1* introduced a breaking change where model fields were deep copied by default, this release reverts the default behaviour to match *v1.9.0* and before, while also allow deep-copy behaviour via `copy_on_model_validation = 'deep'`. See [#4092](https://togithub.com/pydantic/pydantic/pull/4092) for more information. - Allow for shallow copies of model fields, `Config.copy_on_model_validation` is now a str which must be `'none'`, `'deep'`, or `'shallow'` corresponding to not copying, deep copy & shallow copy; default `'shallow'`, [#4093](https://togithub.com/pydantic/pydantic/pull/4093) by [@timkpaine](https://togithub.com/timkpaine) ### [`v1.9.1`](https://togithub.com/pydantic/pydantic/blob/HEAD/HISTORY.md#v191-2022-05-19) [Compare Source](https://togithub.com/pydantic/pydantic/compare/v1.9.0...v1.9.1) Thank you to pydantic's sponsors: [@tiangolo](https://togithub.com/tiangolo), [@stellargraph](https://togithub.com/stellargraph), [@JonasKs](https://togithub.com/JonasKs), [@grillazz](https://togithub.com/grillazz), [@Mazyod](https://togithub.com/Mazyod), [@kevinalh](https://togithub.com/kevinalh), [@chdsbd](https://togithub.com/chdsbd), [@povilasb](https://togithub.com/povilasb), [@povilasb](https://togithub.com/povilasb), [@jina-ai](https://togithub.com/jina-ai), [@mainframeindustries](https://togithub.com/mainframeindustries), [@robusta-dev](https://togithub.com/robusta-dev), [@SendCloud](https://togithub.com/SendCloud), [@rszamszur](https://togithub.com/rszamszur), [@jodal](https://togithub.com/jodal), [@hardbyte](https://togithub.com/hardbyte), [@corleyma](https://togithub.com/corleyma), [@daddycocoaman](https://togithub.com/daddycocoaman), [@Rehket](https://togithub.com/Rehket), [@jokull](https://togithub.com/jokull), [@reillysiemens](https://togithub.com/reillysiemens), [@westonsteimel](https://togithub.com/westonsteimel), [@primer-io](https://togithub.com/primer-io), [@koxudaxi](https://togithub.com/koxudaxi), [@browniebroke](https://togithub.com/browniebroke), [@stradivari96](https://togithub.com/stradivari96), [@adriangb](https://togithub.com/adriangb), [@kamalgill](https://togithub.com/kamalgill), [@jqueguiner](https://togithub.com/jqueguiner), [@dev-zero](https://togithub.com/dev-zero), [@datarootsio](https://togithub.com/datarootsio), [@RedCarpetUp](https://togithub.com/RedCarpetUp) for their kind support. - Limit the size of `generics._generic_types_cache` and `generics._assigned_parameters` to avoid unlimited increase in memory usage, [#4083](https://togithub.com/pydantic/pydantic/pull/4083) by [@samuelcolvin](https://togithub.com/samuelcolvin) - Add Jupyverse and FPS as Jupyter projects using pydantic, [#4082](https://togithub.com/pydantic/pydantic/pull/4082) by [@davidbrochart](https://togithub.com/davidbrochart) - Speedup `__isinstancecheck__` on pydantic models when the type is not a model, may also avoid memory "leaks", [#4081](https://togithub.com/pydantic/pydantic/pull/4081) by [@samuelcolvin](https://togithub.com/samuelcolvin) - Fix in-place modification of `FieldInfo` that caused problems with PEP 593 type aliases, [#4067](https://togithub.com/pydantic/pydantic/pull/4067) by [@adriangb](https://togithub.com/adriangb) - Add support for autocomplete in VS Code via `__dataclass_transform__` when using `pydantic.dataclasses.dataclass`, [#4006](https://togithub.com/pydantic/pydantic/pull/4006) by [@giuliano-oliveira](https://togithub.com/giuliano-oliveira) - Remove benchmarks from codebase and docs, [#3973](https://togithub.com/pydantic/pydantic/pull/3973) by [@samuelcolvin](https://togithub.com/samuelcolvin) - Typing checking with pyright in CI, improve docs on vscode/pylance/pyright, [#3972](https://togithub.com/pydantic/pydantic/pull/3972) by [@samuelcolvin](https://togithub.com/samuelcolvin) - Fix nested Python dataclass schema regression, [#3819](https://togithub.com/pydantic/pydantic/pull/3819) by [@himbeles](https://togithub.com/himbeles) - Update documentation about lazy evaluation of sources for Settings, [#3806](https://togithub.com/pydantic/pydantic/pull/3806) by [@garyd203](https://togithub.com/garyd203) - Prevent subclasses of bytes being converted to bytes, [#3706](https://togithub.com/pydantic/pydantic/pull/3706) by [@samuelcolvin](https://togithub.com/samuelcolvin) - Fixed "error checking inheritance of" when using PEP585 and PEP604 type hints, [#3681](https://togithub.com/pydantic/pydantic/pull/3681) by [@aleksul](https://togithub.com/aleksul) - Allow self referencing `ClassVar`s in models, [#3679](https://togithub.com/pydantic/pydantic/pull/3679) by [@samuelcolvin](https://togithub.com/samuelcolvin) - **Breaking Change, see [#4106](https://togithub.com/pydantic/pydantic/pull/4106)**: Fix issue with self-referencing dataclass, [#3675](https://togithub.com/pydantic/pydantic/pull/3675) by [@uriyyo](https://togithub.com/uriyyo) - Include non-standard port numbers in rendered URLs, [#3652](https://togithub.com/pydantic/pydantic/pull/3652) by [@dolfinus](https://togithub.com/dolfinus) - `Config.copy_on_model_validation` does a deep copy and not a shallow one, [#3641](https://togithub.com/pydantic/pydantic/pull/3641) by [@PrettyWood](https://togithub.com/PrettyWood) - fix: clarify that discriminated unions do not support singletons, [#3636](https://togithub.com/pydantic/pydantic/pull/3636) by [@tommilligan](https://togithub.com/tommilligan) - Add `read_text(encoding='utf-8')` for `setup.py`, [#3625](https://togithub.com/pydantic/pydantic/pull/3625) by [@hswong3i](https://togithub.com/hswong3i) - Fix JSON Schema generation for Discriminated Unions within lists, [#3608](https://togithub.com/pydantic/pydantic/pull/3608) by [@samuelcolvin](https://togithub.com/samuelcolvin) ### [`v1.9.0`](https://togithub.com/pydantic/pydantic/blob/HEAD/HISTORY.md#v190-2021-12-31) [Compare Source](https://togithub.com/pydantic/pydantic/compare/v1.8.2...v1.9.0) Thank you to pydantic's sponsors: [@sthagen](https://togithub.com/sthagen), [@timdrijvers](https://togithub.com/timdrijvers), [@toinbis](https://togithub.com/toinbis), [@koxudaxi](https://togithub.com/koxudaxi), [@ginomempin](https://togithub.com/ginomempin), [@primer-io](https://togithub.com/primer-io), [@and-semakin](https://togithub.com/and-semakin), [@westonsteimel](https://togithub.com/westonsteimel), [@reillysiemens](https://togithub.com/reillysiemens), [@es3n1n](https://togithub.com/es3n1n), [@jokull](https://togithub.com/jokull), [@JonasKs](https://togithub.com/JonasKs), [@Rehket](https://togithub.com/Rehket), [@corleyma](https://togithub.com/corleyma), [@daddycocoaman](https://togithub.com/daddycocoaman), [@hardbyte](https://togithub.com/hardbyte), [@datarootsio](https://togithub.com/datarootsio), [@jodal](https://togithub.com/jodal), [@aminalaee](https://togithub.com/aminalaee), [@rafsaf](https://togithub.com/rafsaf), [@jqueguiner](https://togithub.com/jqueguiner), [@chdsbd](https://togithub.com/chdsbd), [@kevinalh](https://togithub.com/kevinalh), [@Mazyod](https://togithub.com/Mazyod), [@grillazz](https://togithub.com/grillazz), [@JonasKs](https://togithub.com/JonasKs), [@simw](https://togithub.com/simw), [@leynier](https://togithub.com/leynier), [@xfenix](https://togithub.com/xfenix) for their kind support. ##### Highlights - add Python 3.10 support, [#2885](https://togithub.com/pydantic/pydantic/pull/2885) by [@PrettyWood](https://togithub.com/PrettyWood) - [Discriminated unions](https://docs.pydantic.dev/usage/types/#discriminated-unions-aka-tagged-unions), [#619](https://togithub.com/pydantic/pydantic/pull/619) by [@PrettyWood](https://togithub.com/PrettyWood) - [`Config.smart_union` for better union logic](https://docs.pydantic.dev/usage/model_config/#smart-union), [#2092](https://togithub.com/pydantic/pydantic/pull/2092) by [@PrettyWood](https://togithub.com/PrettyWood) - Binaries for Macos M1 CPUs, [#3498](https://togithub.com/pydantic/pydantic/pull/3498) by [@samuelcolvin](https://togithub.com/samuelcolvin) - Complex types can be set via [nested environment variables](https://docs.pydantic.dev/usage/settings/#parsing-environment-variable-values), e.g. `foo___bar`, [#3159](https://togithub.com/pydantic/pydantic/pull/3159) by [@Air-Mark](https://togithub.com/Air-Mark) - add a dark mode to *pydantic* documentation, [#2913](https://togithub.com/pydantic/pydantic/pull/2913) by [@gbdlin](https://togithub.com/gbdlin) - Add support for autocomplete in VS Code via `__dataclass_transform__`, [#2721](https://togithub.com/pydantic/pydantic/pull/2721) by [@tiangolo](https://togithub.com/tiangolo) - Add "exclude" as a field parameter so that it can be configured using model config, [#660](https://togithub.com/pydantic/pydantic/pull/660) by [@daviskirk](https://togithub.com/daviskirk) ##### v1.9.0 (2021-12-31) Changes - Apply `update_forward_refs` to `Config.json_encodes` prevent name clashes in types defined via strings, [#3583](https://togithub.com/pydantic/pydantic/pull/3583) by [@samuelcolvin](https://togithub.com/samuelcolvin) - Extend pydantic's mypy plugin to support mypy versions `0.910`, `0.920`, `0.921` & `0.930`, [#3573](https://togithub.com/pydantic/pydantic/pull/3573) & [#3594](https://togithub.com/pydantic/pydantic/pull/3594) by [@PrettyWood](https://togithub.com/PrettyWood), [@christianbundy](https://togithub.com/christianbundy), [@samuelcolvin](https://togithub.com/samuelcolvin) ##### v1.9.0a2 (2021-12-24) Changes - support generic models with discriminated union, [#3551](https://togithub.com/pydantic/pydantic/pull/3551) by [@PrettyWood](https://togithub.com/PrettyWood) - keep old behaviour of `json()` by default, [#3542](https://togithub.com/pydantic/pydantic/pull/3542) by [@PrettyWood](https://togithub.com/PrettyWood) - Removed typing-only `__root__` attribute from `BaseModel`, [#3540](https://togithub.com/pydantic/pydantic/pull/3540) by [@layday](https://togithub.com/layday) - Build Python 3.10 wheels, [#3539](https://togithub.com/pydantic/pydantic/pull/3539) by [@mbachry](https://togithub.com/mbachry) - Fix display of `extra` fields with model `__repr__`, [#3234](https://togithub.com/pydantic/pydantic/pull/3234) by [@cocolman](https://togithub.com/cocolman) - models copied via `Config.copy_on_model_validation` always have all fields, [#3201](https://togithub.com/pydantic/pydantic/pull/3201) by [@PrettyWood](https://togithub.com/PrettyWood) - nested ORM from nested dictionaries, [#3182](https://togithub.com/pydantic/pydantic/pull/3182) by [@PrettyWood](https://togithub.com/PrettyWood) - fix link to discriminated union section by [@PrettyWood](https://togithub.com/PrettyWood) ##### v1.9.0a1 (2021-12-18) Changes - Add support for `Decimal`-specific validation configurations in `Field()`, additionally to using `condecimal()`, to allow better support from editors and tooling, [#3507](https://togithub.com/pydantic/pydantic/pull/3507) by [@tiangolo](https://togithub.com/tiangolo) - Add `arm64` binaries suitable for MacOS with an M1 CPU to PyPI, [#3498](https://togithub.com/pydantic/pydantic/pull/3498) by [@samuelcolvin](https://togithub.com/samuelcolvin) - Fix issue where `None` was considered invalid when using a `Union` type containing `Any` or `object`, [#3444](https://togithub.com/pydantic/pydantic/pull/3444) by [@tharradine](https://togithub.com/tharradine) - When generating field schema, pass optional `field` argument (of type `pydantic.fields.ModelField`) to `__modify_schema__()` if present, [#3434](https://togithub.com/pydantic/pydantic/pull/3434) by [@jasujm](https://togithub.com/jasujm) - Fix issue when pydantic fail to parse `typing.ClassVar` string type annotation, [#3401](https://togithub.com/pydantic/pydantic/pull/3401) by [@uriyyo](https://togithub.com/uriyyo) - Mention Python >= 3.9.2 as an alternative to `typing_extensions.TypedDict`, [#3374](https://togithub.com/pydantic/pydantic/pull/3374) by [@BvB93](https://togithub.com/BvB93) - Changed the validator method name in the [Custom Errors example](https://docs.pydantic.dev/usage/models/#custom-errors) to more accurately describe what the validator is doing; changed from `name_must_contain_space` to ` value_must_equal_bar `, [#3327](https://togithub.com/pydantic/pydantic/pull/3327) by [@michaelrios28](https://togithub.com/michaelrios28) - Add `AmqpDsn` class, [#3254](https://togithub.com/pydantic/pydantic/pull/3254) by [@kludex](https://togithub.com/kludex) - Always use `Enum` value as default in generated JSON schema, [#3190](https://togithub.com/pydantic/pydantic/pull/3190) by [@joaommartins](https://togithub.com/joaommartins) - Add support for Mypy 0.920, [#3175](https://togithub.com/pydantic/pydantic/pull/3175) by [@christianbundy](https://togithub.com/christianbundy) - `validate_arguments` now supports `extra` customization (used to always be `Extra.forbid`), [#3161](https://togithub.com/pydantic/pydantic/pull/3161) by [@PrettyWood](https://togithub.com/PrettyWood) - Complex types can be set by nested environment variables, [#3159](https://togithub.com/pydantic/pydantic/pull/3159) by [@Air-Mark](https://togithub.com/Air-Mark) - Fix mypy plugin to collect fields based on `pydantic.utils.is_valid_field` so that it ignores untyped private variables, [#3146](https://togithub.com/pydantic/pydantic/pull/3146) by [@hi-ogawa](https://togithub.com/hi-ogawa) - fix `validate_arguments` issue with `Config.validate_all`, [#3135](https://togithub.com/pydantic/pydantic/pull/3135) by [@PrettyWood](https://togithub.com/PrettyWood) - avoid dict coercion when using dict subclasses as field type, [#3122](https://togithub.com/pydantic/pydantic/pull/3122) by [@PrettyWood](https://togithub.com/PrettyWood) - add support for `object` type, [#3062](https://togithub.com/pydantic/pydantic/pull/3062) by [@PrettyWood](https://togithub.com/PrettyWood) - Updates pydantic dataclasses to keep `_special` properties on parent classes, [#3043](https://togithub.com/pydantic/pydantic/pull/3043) by [@zulrang](https://togithub.com/zulrang) - Add a `TypedDict` class for error objects, [#3038](https://togithub.com/pydantic/pydantic/pull/3038) by [@matthewhughes934](https://togithub.com/matthewhughes934) - Fix support for using a subclass of an annotation as a default, [#3018](https://togithub.com/pydantic/pydantic/pull/3018) by [@JacobHayes](https://togithub.com/JacobHayes) - make `create_model_from_typeddict` mypy compliant, [#3008](https://togithub.com/pydantic/pydantic/pull/3008) by [@PrettyWood](https://togithub.com/PrettyWood) - Make multiple inheritance work when using `PrivateAttr`, [#2989](https://togithub.com/pydantic/pydantic/pull/2989) by [@hmvp](https://togithub.com/hmvp) - Parse environment variables as JSON, if they have a `Union` type with a complex subfield, [#2936](https://togithub.com/pydantic/pydantic/pull/2936) by [@cbartz](https://togithub.com/cbartz) - Prevent `StrictStr` permitting `Enum` values where the enum inherits from `str`, [#2929](https://togithub.com/pydantic/pydantic/pull/2929) by [@samuelcolvin](https://togithub.com/samuelcolvin) - Make `SecretsSettingsSource` parse values being assigned to fields of complex types when sourced from a secrets file, just as when sourced from environment variables, [#2917](https://togithub.com/pydantic/pydantic/pull/2917) by [@davidmreed](https://togithub.com/davidmreed) - add a dark mode to *pydantic* documentation, [#2913](https://togithub.com/pydantic/pydantic/pull/2913) by [@gbdlin](https://togithub.com/gbdlin) - Make `pydantic-mypy` plugin compatible with `pyproject.toml` configuration, consistent with `mypy` changes. See the [doc](https://docs.pydantic.dev/mypy_plugin/#configuring-the-plugin) for more information, [#2908](https://togithub.com/pydantic/pydantic/pull/2908) by [@jrwalk](https://togithub.com/jrwalk) - add Python 3.10 support, [#2885](https://togithub.com/pydantic/pydantic/pull/2885) by [@PrettyWood](https://togithub.com/PrettyWood) - Correctly parse generic models with `Json[T]`, [#2860](https://togithub.com/pydantic/pydantic/pull/2860) by [@geekingfrog](https://togithub.com/geekingfrog) - Update contrib docs re: Python version to use for building docs, [#2856](https://togithub.com/pydantic/pydantic/pull/2856) by [@paxcodes](https://togithub.com/paxcodes) - Clarify documentation about *pydantic*'s support for custom validation and strict type checking, despite *pydantic* being primarily a parsing library, [#2855](https://togithub.com/pydantic/pydantic/pull/2855) by [@paxcodes](https://togithub.com/paxcodes) - Fix schema generation for `Deque` fields, [#2810](https://togithub.com/pydantic/pydantic/pull/2810) by [@sergejkozin](https://togithub.com/sergejkozin) - fix an edge case when mixing constraints and `Literal`, [#2794](https://togithub.com/pydantic/pydantic/pull/2794) by [@PrettyWood](https://togithub.com/PrettyWood) - Fix postponed annotation resolution for `NamedTuple` and `TypedDict` when they're used directly as the type of fields within Pydantic models, [#2760](https://togithub.com/pydantic/pydantic/pull/2760) by [@jameysharp](https://togithub.com/jameysharp) - Fix bug when `mypy` plugin fails on `construct` method call for `BaseSettings` derived classes, [#2753](https://togithub.com/pydantic/pydantic/pull/2753) by [@uriyyo](https://togithub.com/uriyyo) - Add function overloading for a `pydantic.create_model` function, [#2748](https://togithub.com/pydantic/pydantic/pull/2748) by [@uriyyo](https://togithub.com/uriyyo) - Fix mypy plugin issue with self field declaration, [#2743](https://togithub.com/pydantic/pydantic/pull/2743) by [@uriyyo](https://togithub.com/uriyyo) - The colon at the end of the line "The fields which were supplied when user was initialised:" suggests that the code following it is related. Changed it to a period, [#2733](https://togithub.com/pydantic/pydantic/pull/2733) by [@krisaoe](https://togithub.com/krisaoe) - Renamed variable `schema` to `schema_` to avoid shadowing of global variable name, [#2724](https://togithub.com/pydantic/pydantic/pull/2724) by [@shahriyarr](https://togithub.com/shahriyarr) - Add support for autocomplete in VS Code via `__dataclass_transform__`, [#2721](https://togithub.com/pydantic/pydantic/pull/2721) by [@tiangolo](https://togithub.com/tiangolo) - add missing type annotations in `BaseConfig` and handle `max_length = 0`, [#2719](https://togithub.com/pydantic/pydantic/pull/2719) by [@PrettyWood](https://togithub.com/PrettyWood) - Change `orm_mode` checking to allow recursive ORM mode parsing with dicts, [#2718](https://togithub.com/pydantic/pydantic/pull/2718) by [@nuno-andre](https://togithub.com/nuno-andre) - Add episode 313 of the *Talk Python To Me* podcast, where Michael Kennedy and Samuel Colvin discuss Pydantic, to the docs, [#2712](https://togithub.com/pydantic/pydantic/pull/2712) by [@RatulMaharaj](https://togithub.com/RatulMaharaj) - fix JSON schema generation when a field is of type `NamedTuple` and has a default value, [#2707](https://togithub.com/pydantic/pydantic/pull/2707) by [@PrettyWood](https://togithub.com/PrettyWood) - `Enum` fields now properly support extra kwargs in schema generation, [#2697](https://togithub.com/pydantic/pydantic/pull/2697) by [@sammchardy](https://togithub.com/sammchardy) - **Breaking Change, see [#3780](https://togithub.com/pydantic/pydantic/pull/3780)**: Make serialization of referenced pydantic models possible, [#2650](https://togithub.com/pydantic/pydantic/pull/2650) by [@PrettyWood](https://togithub.com/PrettyWood) - Add `uniqueItems` option to `ConstrainedList`, [#2618](https://togithub.com/pydantic/pydantic/pull/2618) by [@nuno-andre](https://togithub.com/nuno-andre) - Try to evaluate forward refs automatically at model creation, [#2588](https://togithub.com/pydantic/pydantic/pull/2588) by [@uriyyo](https://togithub.com/uriyyo) - Switch docs preview and coverage display to use [smokeshow](https://smokeshow.helpmanual.io/), [#2580](https://togithub.com/pydantic/pydantic/pull/2580) by [@samuelcolvin](https://togithub.com/samuelcolvin) - Add `__version__` attribute to pydantic module, [#2572](https://togithub.com/pydantic/pydantic/pull/2572) by [@paxcodes](https://togithub.com/paxcodes) - Add `postgresql+asyncpg`, `postgresql+pg8000`, `postgresql+psycopg2`, `postgresql+psycopg2cffi`, `postgresql+py-postgresql` and `postgresql+pygresql` schemes for `PostgresDsn`, [#2567](https://togithub.com/pydantic/pydantic/pull/2567) by [@postgres-asyncpg](https://togithub.com/postgres-asyncpg) - Enable the Hypothesis plugin to generate a constrained decimal when the `decimal_places` argument is specified, [#2524](https://togithub.com/pydantic/pydantic/pull/2524) by [@cwe5590](https://togithub.com/cwe5590) - Allow `collections.abc.Callable` to be used as type in Python 3.9, [#2519](https://togithub.com/pydantic/pydantic/pull/2519) by [@daviskirk](https://togithub.com/daviskirk) - Documentation update how to custom compile pydantic when using pip install, small change in `setup.py` to allow for custom CFLAGS when compiling, [#2517](https://togithub.com/pydantic/pydantic/pull/2517) by [@peterroelants](https://togithub.com/peterroelants) - remove side effect of `default_factory` to run it only once even if `Config.validate_all` is set, [#2515](https://togithub.com/pydantic/pydantic/pull/2515) by [@PrettyWood](https://togithub.com/PrettyWood) - Add lookahead to ip regexes for `AnyUrl` hosts. This allows urls with DNS labels looking like IPs to validate as they are perfectly valid host names, [#2512](https://togithub.com/pydantic/pydantic/pull/2512) by [@sbv-csis](https://togithub.com/sbv-csis) - Set `minItems` and `maxItems` in generated JSON schema for fixed-length tuples, [#2497](https://togithub.com/pydantic/pydantic/pull/2497) by [@PrettyWood](https://togithub.com/PrettyWood) - Add `strict` argument to `conbytes`, [#2489](https://togithub.com/pydantic/pydantic/pull/2489) by [@koxudaxi](https://togithub.com/koxudaxi) - Support user defined generic field types in generic models, [#2465](https://togithub.com/pydantic/pydantic/pull/2465) by [@daviskirk](https://togithub.com/daviskirk) - Add an example and a short explanation of subclassing `GetterDict` to docs, [#2463](https://togithub.com/pydantic/pydantic/pull/2463) by [@nuno-andre](https://togithub.com/nuno-andre) - add `KafkaDsn` type, `HttpUrl` now has default port 80 for http and 443 for https, [#2447](https://togithub.com/pydantic/pydantic/pull/2447) by [@MihanixA](https://togithub.com/MihanixA) - Add `PastDate` and `FutureDate` types, [#2425](https://togithub.com/pydantic/pydantic/pull/2425) by [@Kludex](https://togithub.com/Kludex) - Support generating schema for `Generic` fields with subtypes, [#2375](https://togithub.com/pydantic/pydantic/pull/2375) by [@maximberg](https://togithub.com/maximberg) - fix(encoder): serialize `NameEmail` to str, [#2341](https://togithub.com/pydantic/pydantic/pull/2341) by [@alecgerona](https://togithub.com/alecgerona) - add `Config.smart_union` to prevent coercion in `Union` if possible, see [the doc](https://docs.pydantic.dev/usage/model_config/#smart-union) for more information, [#2092](https://togithub.com/pydantic/pydantic/pull/2092) by [@PrettyWood](https://togithub.com/PrettyWood) - Add ability to use `typing.Counter` as a model field type, [#2060](https://togithub.com/pydantic/pydantic/pull/2060) by [@uriyyo](https://togithub.com/uriyyo) - Add parameterised subclasses to `__bases__` when constructing new parameterised classes, so that `A <: B => A[int] <: B[int]`, [#2007](https://togithub.com/pydantic/pydantic/pull/2007) by [@diabolo-dan](https://togithub.com/diabolo-dan) - Create `FileUrl` type that allows URLs that conform to [RFC 8089](https://tools.ietf.org/html/rfc8089#section-2). Add `host_required` parameter, which is `True` by default (`AnyUrl` and subclasses), `False` in `RedisDsn`, `FileUrl`, [#1983](https://togithub.com/pydantic/pydantic/pull/1983) by [@vgerak](https://togithub.com/vgerak) - add `confrozenset()`, analogous to `conset()` and `conlist()`, [#1897](https://togithub.com/pydantic/pydantic/pull/1897) by [@PrettyWood](https://togithub.com/PrettyWood) - stop calling parent class `root_validator` if overridden, [#1895](https://togithub.com/pydantic/pydantic/pull/1895) by [@PrettyWood](https://togithub.com/PrettyWood) - Add `repr` (defaults to `True`) parameter to `Field`, to hide it from the default representation of the `BaseModel`, [#1831](https://togithub.com/pydantic/pydantic/pull/1831) by [@fnep](https://togithub.com/fnep) - Accept empty query/fragment URL parts, [#1807](https://togithub.com/pydantic/pydantic/pull/1807) by [@xavier](https://togithub.com/xavier) ### [`v1.8.2`](https://togithub.com/pydantic/pydantic/blob/HEAD/HISTORY.md#v182-2021-05-11) [Compare Source](https://togithub.com/pydantic/pydantic/compare/v1.8.1...v1.8.2) !!! warning A security vulnerability, level "moderate" is fixed in v1.8.2. Please upgrade **ASAP**. See security advisory [CVE-2021-29510](https://togithub.com/pydantic/pydantic/security/advisories/GHSA-5jqp-qgf6-3pvh) - **Security fix:** Fix `date` and `datetime` parsing so passing either `'infinity'` or `float('inf')` (or their negative values) does not cause an infinite loop, see security advisory [CVE-2021-29510](https://togithub.com/pydantic/pydantic/security/advisories/GHSA-5jqp-qgf6-3pvh) - fix schema generation with Enum by generating a valid name, [#2575](https://togithub.com/pydantic/pydantic/pull/2575) by [@PrettyWood](https://togithub.com/PrettyWood) - fix JSON schema generation with a `Literal` of an enum member, [#2536](https://togithub.com/pydantic/pydantic/pull/2536) by [@PrettyWood](https://togithub.com/PrettyWood) - Fix bug with configurations declarations that are passed as keyword arguments during class creation, [#2532](https://togithub.com/pydantic/pydantic/pull/2532) by [@uriyyo](https://togithub.com/uriyyo) - Allow passing `json_encoders` in class kwargs, [#2521](https://togithub.com/pydantic/pydantic/pull/2521) by [@layday](https://togithub.com/layday) - support arbitrary types with custom `__eq__`, [#2483](https://togithub.com/pydantic/pydantic/pull/2483) by [@PrettyWood](https://togithub.com/PrettyWood) - support `Annotated` in `validate_arguments` and in generic models with Python 3.9, [#2483](https://togithub.com/pydantic/pydantic/pull/2483) by [@PrettyWood](https://togithub.com/PrettyWood) ### [`v1.8.1`](https://togithub.com/pydantic/pydantic/blob/HEAD/HISTORY.md#v181-2021-03-03) [Compare Source](https://togithub.com/pydantic/pydantic/compare/v1.8...v1.8.1) Bug fixes for regressions and new features from `v1.8` - allow elements of `Config.field` to update elements of a `Field`, [#2461](https://togithub.com/pydantic/pydantic/pull/2461) by [@samuelcolvin](https://togithub.com/samuelcolvin) - fix validation with a `BaseModel` field and a custom root type, [#2449](https://togithub.com/pydantic/pydantic/pull/2449) by [@PrettyWood](https://togithub.com/PrettyWood) - expose `Pattern` encoder to `fastapi`, [#2444](https://togithub.com/pydantic/pydantic/pull/2444) by [@PrettyWood](https://togithub.com/PrettyWood) - enable the Hypothesis plugin to generate a constrained float when the `multiple_of` argument is specified, [#2442](https://togithub.com/pydantic/pyda
Configuration
📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.