You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: python/pydantic_core/core_schema.py
+14-20
Original file line number
Diff line number
Diff line change
@@ -54,8 +54,6 @@ class CoreConfig(TypedDict, total=False):
54
54
`field_names` to construct error `loc`s. Default is `True`.
55
55
revalidate_instances: Whether instances of models and dataclasses should re-validate. Default is 'never'.
56
56
validate_default: Whether to validate default values during validation. Default is `False`.
57
-
populate_by_name: Whether an aliased field may be populated by its name as given by the model attribute,
58
-
as well as the alias. (Replaces 'allow_population_by_field_name' in Pydantic v1.) Default is `False`.
59
57
str_max_length: The maximum length for string fields.
60
58
str_min_length: The minimum length for string fields.
61
59
str_strip_whitespace: Whether to strip whitespace from string fields.
@@ -74,6 +72,9 @@ class CoreConfig(TypedDict, total=False):
74
72
regex_engine: The regex engine to use for regex pattern validation. Default is 'rust-regex'. See `StringSchema`.
75
73
cache_strings: Whether to cache strings. Default is `True`, `True` or `'all'` is required to cache strings
76
74
during general validation since validators don't know if they're in a key or a value.
75
+
validate_by_alias: Whether to use the field's alias when validating against the provided input data. Default is `True`.
76
+
validate_by_name: Whether to use the field's name when validating against the provided input data. Default is `False`. Replacement for `populate_by_name`.
77
+
serialize_by_alias: Whether to serialize by alias. Default is `False`, expected to change to `True` in V3.
77
78
"""
78
79
79
80
title: str
@@ -91,7 +92,6 @@ class CoreConfig(TypedDict, total=False):
91
92
# whether to validate default values during validation, default False
92
93
validate_default: bool
93
94
# used on typed-dicts and arguments
94
-
populate_by_name: bool# replaces `allow_population_by_field_name` in pydantic v1
95
95
# fields related to string fields only
96
96
str_max_length: int
97
97
str_min_length: int
@@ -111,6 +111,9 @@ class CoreConfig(TypedDict, total=False):
0 commit comments