Pydantic

Latest version: v2.10.4

Safety actively analyzes 693883 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 15 of 26

1.7.3

Not secure
Thank you to pydantic's sponsors:
timdrijvers, BCarley, chdsbd, tiangolo, matin, linusg, kevinalh, jorgecarleitao, koxudaxi, primer-api,
mkeen, meadsteve for their kind support.

* fix: set right default value for required (optional) fields, [2142](https://github.com/pydantic/pydantic/pull/2142) by PrettyWood
* fix: support `underscore_attrs_are_private` with generic models, [2138](https://github.com/pydantic/pydantic/pull/2138) by PrettyWood
* fix: update all modified field values in `root_validator` when `validate_assignment` is on, [2116](https://github.com/pydantic/pydantic/pull/2116) by PrettyWood
* Allow pickling of `pydantic.dataclasses.dataclass` dynamically created from a built-in `dataclasses.dataclass`, [2111](https://github.com/pydantic/pydantic/pull/2111) by aimestereo
* Fix a regression where Enum fields would not propagate keyword arguments to the schema, [2109](https://github.com/pydantic/pydantic/pull/2109) by bm424
* Ignore `__doc__` as private attribute when `Config.underscore_attrs_are_private` is set, [2090](https://github.com/pydantic/pydantic/pull/2090) by PrettyWood

1.7.2

Not secure
* fix slow `GenericModel` concrete model creation, allow `GenericModel` concrete name reusing in module, [2078](https://github.com/pydantic/pydantic/pull/2078) by Bobronium
* keep the order of the fields when `validate_assignment` is set, [2073](https://github.com/pydantic/pydantic/pull/2073) by PrettyWood
* forward all the params of the stdlib `dataclass` when converted into _pydantic_ `dataclass`, [2065](https://github.com/pydantic/pydantic/pull/2065) by PrettyWood

1.7.1

Not secure
Thank you to pydantic's sponsors:
timdrijvers, BCarley, chdsbd, tiangolo, matin, linusg, kevinalh, jorgecarleitao, koxudaxi, primer-api, mkeen
for their kind support.

* fix annotation of `validate_arguments` when passing configuration as argument, [2055](https://github.com/pydantic/pydantic/pull/2055) by layday
* Fix mypy assignment error when using `PrivateAttr`, [2048](https://github.com/pydantic/pydantic/pull/2048) by aphedges
* fix `underscore_attrs_are_private` causing `TypeError` when overriding `__init__`, [2047](https://github.com/pydantic/pydantic/pull/2047) by samuelcolvin
* Fixed regression introduced in v1.7 involving exception handling in field validators when `validate_assignment=True`, [2044](https://github.com/pydantic/pydantic/pull/2044) by johnsabath
* fix: _pydantic_ `dataclass` can inherit from stdlib `dataclass`
and `Config.arbitrary_types_allowed` is supported, [2042](https://github.com/pydantic/pydantic/pull/2042) by PrettyWood

1.7

Not secure
Thank you to pydantic's sponsors:
timdrijvers, BCarley, chdsbd, tiangolo, matin, linusg, kevinalh, jorgecarleitao, koxudaxi, primer-api
for their kind support.

Highlights

* Python 3.9 support, thanks PrettyWood
* [Private model attributes](https://docs.pydantic.dev/usage/models/#private-model-attributes), thanks Bobronium
* ["secrets files" support in `BaseSettings`](https://docs.pydantic.dev/usage/settings/#secret-support), thanks mdgilene
* [convert stdlib dataclasses to pydantic dataclasses and use stdlib dataclasses in models](https://docs.pydantic.dev/usage/dataclasses/#stdlib-dataclasses-and-pydantic-dataclasses), thanks PrettyWood

Changes

* **Breaking Change:** remove `__field_defaults__`, add `default_factory` support with `BaseModel.construct`.
Use `.get_default()` method on fields in `__fields__` attribute instead, [1732](https://github.com/pydantic/pydantic/pull/1732) by PrettyWood
* Rearrange CI to run linting as a separate job, split install recipes for different tasks, [2020](https://github.com/pydantic/pydantic/pull/2020) by samuelcolvin
* Allows subclasses of generic models to make some, or all, of the superclass's type parameters concrete, while
also defining new type parameters in the subclass, [2005](https://github.com/pydantic/pydantic/pull/2005) by choogeboom
* Call validator with the correct `values` parameter type in `BaseModel.__setattr__`,
when `validate_assignment = True` in model config, [1999](https://github.com/pydantic/pydantic/pull/1999) by me-ransh
* Force `fields.Undefined` to be a singleton object, fixing inherited generic model schemas, [1981](https://github.com/pydantic/pydantic/pull/1981) by daviskirk
* Include tests in source distributions, [1976](https://github.com/pydantic/pydantic/pull/1976) by sbraz
* Add ability to use `min_length/max_length` constraints with secret types, [1974](https://github.com/pydantic/pydantic/pull/1974) by uriyyo
* Also check `root_validators` when `validate_assignment` is on, [1971](https://github.com/pydantic/pydantic/pull/1971) by PrettyWood
* Fix const validators not running when custom validators are present, [1957](https://github.com/pydantic/pydantic/pull/1957) by hmvp
* add `deque` to field types, [1935](https://github.com/pydantic/pydantic/pull/1935) by wozniakty
* add basic support for Python 3.9, [1832](https://github.com/pydantic/pydantic/pull/1832) by PrettyWood
* Fix typo in the anchor of exporting_models.mdmodelcopy and incorrect description, [1821](https://github.com/pydantic/pydantic/pull/1821) by KimMachineGun
* Added ability for `BaseSettings` to read "secret files", [1820](https://github.com/pydantic/pydantic/pull/1820) by mdgilene
* add `parse_raw_as` utility function, [1812](https://github.com/pydantic/pydantic/pull/1812) by PrettyWood
* Support home directory relative paths for `dotenv` files (e.g. `~/.env`), [1803](https://github.com/pydantic/pydantic/pull/1803) by PrettyWood
* Clarify documentation for `parse_file` to show that the argument
should be a file *path* not a file-like object, [1794](https://github.com/pydantic/pydantic/pull/1794) by mdavis-xyz
* Fix false positive from mypy plugin when a class nested within a `BaseModel` is named `Model`, [1770](https://github.com/pydantic/pydantic/pull/1770) by selimb
* add basic support of Pattern type in schema generation, [1767](https://github.com/pydantic/pydantic/pull/1767) by PrettyWood
* Support custom title, description and default in schema of enums, [1748](https://github.com/pydantic/pydantic/pull/1748) by PrettyWood
* Properly represent `Literal` Enums when `use_enum_values` is True, [1747](https://github.com/pydantic/pydantic/pull/1747) by noelevans
* Allows timezone information to be added to strings to be formatted as time objects. Permitted formats are `Z` for UTC
or an offset for absolute positive or negative time shifts. Or the timezone data can be omitted, [1744](https://github.com/pydantic/pydantic/pull/1744) by noelevans
* Add stub `__init__` with Python 3.6 signature for `ForwardRef`, [1738](https://github.com/pydantic/pydantic/pull/1738) by sirtelemak
* Fix behaviour with forward refs and optional fields in nested models, [1736](https://github.com/pydantic/pydantic/pull/1736) by PrettyWood
* add `Enum` and `IntEnum` as valid types for fields, [1735](https://github.com/pydantic/pydantic/pull/1735) by PrettyWood
* Change default value of `__module__` argument of `create_model` from `None` to `'pydantic.main'`.
Set reference of created concrete model to it's module to allow pickling (not applied to models created in
functions), [1686](https://github.com/pydantic/pydantic/pull/1686) by Bobronium
* Add private attributes support, [1679](https://github.com/pydantic/pydantic/pull/1679) by Bobronium
* add `config` to `validate_arguments`, [1663](https://github.com/pydantic/pydantic/pull/1663) by samuelcolvin
* Allow descendant Settings models to override env variable names for the fields defined in parent Settings models with
`env` in their `Config`. Previously only `env_prefix` configuration option was applicable, [1561](https://github.com/pydantic/pydantic/pull/1561) by ojomio
* Support `ref_template` when creating schema `$ref`s, [1479](https://github.com/pydantic/pydantic/pull/1479) by kilo59
* Add a `__call__` stub to `PyObject` so that mypy will know that it is callable, [1352](https://github.com/pydantic/pydantic/pull/1352) by brianmaissy
* `pydantic.dataclasses.dataclass` decorator now supports built-in `dataclasses.dataclass`.
It is hence possible to convert an existing `dataclass` easily to add Pydantic validation.
Moreover nested dataclasses are also supported, [744](https://github.com/pydantic/pydantic/pull/744) by PrettyWood

1.6.2

Not secure
* **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://github.com/pydantic/pydantic/security/advisories/GHSA-5jqp-qgf6-3pvh)

1.6.1

Not secure
* fix validation and parsing of nested models with `default_factory`, [1710](https://github.com/pydantic/pydantic/pull/1710) by PrettyWood

Page 15 of 26

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.