Data validation using Python type hints
cached_property
handling in dataclasses when copied by @rdbisme in https://github.com/pydantic/pydantic/pull/8407
Full Changelog: https://github.com/pydantic/pydantic/compare/v1.10.13...v1.10.14
pydantic-core
to 2.14.6Full Changelog: https://github.com/pydantic/pydantic/compare/v2.5.2...v2.5.3/
pydantic-core
to 2.14.5ConfigDict.ser_json_inf_nan
by @davidhewitt in #8159
Literal
from JSON keys when used as dict
key by @sydney-runkle in pydantic/pydantic-core#1075
custom_init
on members of Union
by @sydney-runkle in pydantic/pydantic-core#1076
JsonValue
bool
serialization by @sydney-runkle in #8190
Literal
in Union
s by @sydney-runkle in pydantic/pydantic-core#1089
https://github.com/pydantic/pydantic/compare/v2.5.1...v2.5.2/
ValidateCallWrapper
error when creating a model which has a @validate_call wrapped field annotation by @sydney-runkle in #8110
Full Changelog: https://github.com/pydantic/pydantic/compare/v2.5.0...v2.5.1/
The code released in v2.5.0 is functionally identical to that of v2.5.0b1.
pyright==1.1.335
by @Viicos in #8075
ValidationError
errors by @adriangb in #7806
__doc__
argument in create_model()
by @chris-spann in #7863
regex_engine
flag - meaning you can use with the Rust or Python regex libraries in constraints by @utkini in #7768
ComputedFieldInfo
by @alexmojaki in #7889
ruff
formatter by @Luca-Blight in #7930
validation_error_cause
to config by @zakstucke in #7626
CallableDiscriminator
and Tag
by @dmontagu in #7983
CallableDiscriminator
renamed to Discriminator
by @dmontagu in #8047
examples
and json_schema_extra
to @computed_field
by @alexmojaki in #8013
JsonValue
type by @dmontagu in #7998
str
as argument to Discriminator
by @dmontagu in #8047
SchemaSerializer.__reduce__
method to enable pickle serialization by @edoakes in pydantic/pydantic-core#1006
ultra_strict
with new smart union implementation, the way unions are validated has changed significantly to improve performance and correctness, we have worked hard to absolutely minimise the number of cases where behaviour has changed, see the PR for details - by @davidhewitt in pydantic/pydantic-core#867
extra='allow'
by @sydney-runkle in #7683
Enum
types with no cases by @sydney-runkle in #7927
Generic
before BaseModel
by @alexmojaki in #7891
jiter
by @samuelcolvin in pydantic/pydantic-core#974
__getattr__
for all package imports, improve import time by @samuelcolvin in #7947
mypy
issue with subclasses of RootModel
by @sydney-runkle in #7677
FieldInfo
when a forward ref gets evaluated by @dmontagu in #7698
SecretStr
from JSON (regression in v2.4) by @sydney-runkle in #7729
defer_build
behavior with TypeAdapter
by @sydney-runkle in #7736
mypy
versions by @dmontagu in #7742
TypeVar
handling when default is not set by @pmmmwh in #7719
strict
on Enum
type fields by @sydney-runkle in #7761
weakref.ref
instead of subclassing to fix cloudpickle
serialization by @edoakes in #7780
model_post_init
in subclasses by @alexmojaki in #7775
json_schema_extra
by @alexmojaki in #7803
strict
specification for UUID
types by @sydney-runkle in #7865
pydantic.Field(kw_only=True)
with inherited dataclasses by @PrettyWood in #7827
validate_call
decorator for methods in classes with __slots__
by @sydney-runkle in #7883
dataclasses.field
default by @hramezani in #7898
importlib_metadata
on python 3.7 by @sydney-runkle in #7904
|
operator (Union) in PydanticRecursiveRef by @alexmojaki in #7892
display_as_type
for TypeAliasType
in python 3.12 by @dmontagu in #7929
NotRequired
generics in TypedDict
by @sydney-runkle in #7932
TypeAliasType
specifications produce different schema definitions by @alexdrydew in #7893
PrivateAttr
is passed from Annotated
default position by @tabassco in #8004
classmethod
instead of classmethod[Any, Any, Any]
by @Mr-Pepe in #7979
Optional
field with validate_default
only performing one field validation by @sydney-runkle in pydantic/pydantic-core#1002
definition-ref
bug with Dict
keys by @sydney-runkle in pydantic/pydantic-core#1014
bool
types with coerce_numbers_to_str=True
by @sydney-runkle in pydantic/pydantic-core#1017
NaN
in float and decimal constraints by @davidhewitt in pydantic/pydantic-core#1037
lax_str
and lax_int
support for enum values not inherited from str/int by @michaelhly in pydantic/pydantic-core#1015
Union
of List
types by @sydney-runkle in pydantic/pydantic-core#1039
max_digits
and decimals
to pass if normalized or non-normalized input is valid by @sydney-runkle in pydantic/pydantic-core#1049
ValidationError
messages by @Iipin in pydantic/pydantic-core#1050
'-'
as datetime
input by @davidhewitt in pydantic/speedate#52 & pydantic/pydantic-core#1060
pydantic
pydantic-core
Full Changelog: https://github.com/pydantic/pydantic/compare/v2.4.2...v2.5.0
ValidationError
errors by @adriangb in #7806
__doc__
argument in create_model()
by @chris-spann in #7863
regex_engine
flag - meaning you can use with the Rust or Python regex libraries in constraints by @utkini in #7768
ComputedFieldInfo
by @alexmojaki in #7889
ruff
formatter by @Luca-Blight in #7930
validation_error_cause
to config by @zakstucke in #7626
CallableDiscriminator
and Tag
by @dmontagu in #7983
examples
and json_schema_extra
to @computed_field
by @alexmojaki in #8013
JsonValue
type by @dmontagu in #7998
str
as argument to Discriminator
by @dmontagu in #8047
SchemaSerializer.__reduce__
method to enable pickle serialization by @edoakes in pydantic/pydantic-core#1006
ultra_strict
with new smart union implementation, the way unions are validated has changed significantly to improve performance and correctness, we have worked hard to absolutely minimise the number of cases where behaviour has changed, see the PR for details - by @davidhewitt in pydantic/pydantic-core#867
extra='allow'
by @sydney-runkle in #7683
Enum
types with no cases by @sydney-runkle in #7927
Generic
before BaseModel
by @alexmojaki in #7891
jiter
by @samuelcolvin in pydantic/pydantic-core#974
__getattr__
for all package imports, improve import time by @samuelcolvin in #7947
mypy
issue with subclasses of RootModel
by @sydney-runkle in #7677
FieldInfo
when a forward ref gets evaluated by @dmontagu in #7698
SecretStr
from JSON (regression in v2.4) by @sydney-runkle in #7729
defer_build
behavior with TypeAdapter
by @sydney-runkle in #7736
mypy
versions by @dmontagu in #7742
TypeVar
handling when default is not set by @pmmmwh in #7719
strict
on Enum
type fields by @sydney-runkle in #7761
weakref.ref
instead of subclassing to fix cloudpickle
serialization by @edoakes in #7780
model_post_init
in subclasses by @alexmojaki in #7775
json_schema_extra
by @alexmojaki in #7803
strict
specification for UUID
types by @sydney-runkle in #7865
pydantic.Field(kw_only=True)
with inherited dataclasses by @PrettyWood in #7827
validate_call
decorator for methods in classes with __slots__
by @sydney-runkle in #7883
dataclasses.field
default by @hramezani in #7898
importlib_metadata
on python 3.7 by @sydney-runkle in #7904
|
operator (Union) in PydanticRecursiveRef by @alexmojaki in #7892
display_as_type
for TypeAliasType
in python 3.12 by @dmontagu in #7929
NotRequired
generics in TypedDict
by @sydney-runkle in #7932
TypeAliasType
specifications produce different schema definitions by @alexdrydew in #7893
PrivateAttr
is passed from Annotated
default position by @tabassco in #8004
classmethod
instead of classmethod[Any, Any, Any]
by @Mr-Pepe in #7979
Optional
field with validate_default
only performing one field validation by @sydney-runkle in pydantic/pydantic-core#1002
definition-ref
bug with Dict
keys by @sydney-runkle in pydantic/pydantic-core#1014
bool
types with coerce_numbers_to_str=True
by @sydney-runkle in pydantic/pydantic-core#1017
NaN
in float and decimal constraints by @davidhewitt in pydantic/pydantic-core#1037
lax_str
and lax_int
support for enum values not inherited from str/int by @michaelhly in pydantic/pydantic-core#1015
Union
of List
types by @sydney-runkle in pydantic/pydantic-core#1039
max_digits
and decimals
to pass if normalized or non-normalized input is valid by @sydney-runkle in pydantic/pydantic-core#1049
ValidationError
messages by @Iipin in pydantic/pydantic-core#1050
'-'
as datetime
input by @davidhewitt in pydantic/speedate#52 & pydantic/pydantic-core#1060
pydantic
pydantic-core
Full changelog: Full Changelog: https://github.com/pydantic/pydantic/compare/v2.4.2...v2.5.0b1/
models_json_schema
for generic models by @adriangb in #7654
Full Changelog: https://github.com/pydantic/pydantic/compare/v2.4.1...v2.4.2/
validate_email
by @hramezani in https://github.com/pydantic/pydantic/pull/7673
Full Changelog: https://github.com/pydantic/pydantic/compare/v1.10.12...v1.10.13
Any
by @adriangb in #7606
Full Changelog: https://github.com/pydantic/pydantic/compare/v2.4.0...v2.4.1/
Base64Url
types by @dmontagu in #7286
number
to str
coercion by @lig in #7508
field_name
and data
in all validators if there is data and a field name by @samuelcolvin in #7542
BaseModel.model_validate_strings
and TypeAdapter.validate_strings
by @hramezani in #7552
plugins
experimental implementation by @lig @samuelcolvin and @Kludex in #6820
model_post_init
in subclass with private attrs by @Viicos in #7302
Extra
as deprecated by @disrupted in #7299
EncodedStr
a dataclass by @Kludex in #7396
annotated_handlers
to be public by @samuelcolvin in #7569
CoreSchema
by @adriangb in #7523
CoreSchema
walking by @adriangb in #7528
dict.get
and dict.setdefault
with more verbose versions in CoreSchema
building hot paths by @adriangb in #7536
CoreSchema
discovery by @adriangb in #7535
CoreSchema
validation for faster startup times by @adriangb in #7565
TypedDict
from grandparent classes by @dmontagu in #7272
strict
config overridable in field for Path by @hramezani in #7281
ser_json_<timedelta|bytes>
on default in GenerateJsonSchema
by @Kludex in #7269
SkipValidation
to referenced schemas by @adriangb in #7381
__get_pydantic_core_schema__
signature by @hramezani in #7415
TypeAdapter
) by @sydney-runkle in #7435
TypeError
on model_validator
in wrap
mode by @pmmmwh in #7496
repr
work for instances that failed initialization when handling ValidationError
s by @dmontagu in #7439
UUID
values having UUID.version=None
by @lig in #7566
__iter__
returning private cached_property
info by @sydney-runkle in #7570
Full Changelog: https://github.com/pydantic/pydantic/compare/v2.3.0...v2.4.0