Skip to content

Commit f6cde33

Browse files
committed
docs suggestion by @Viicos
1 parent 4fac099 commit f6cde33

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

python/pydantic_core/_pydantic_core.pyi

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,8 @@ class SchemaValidator:
116116
allow_partial: Whether to allow partial validation; if `True` errors in the last element of sequences
117117
and mappings are ignored.
118118
`'trailing-strings'` means any final unfinished JSON string is included in the result.
119-
by_alias: Whether to use the field's alias to match the input data to an attribute.
120-
by_name: Whether to use the field's name to match the input data to an attribute.
119+
by_alias: Whether to use the field's alias when validating against the provided input data.
120+
by_name: Whether to use the field's name when validating against the provided input data.
121121
122122
Raises:
123123
ValidationError: If validation fails.
@@ -176,8 +176,8 @@ class SchemaValidator:
176176
allow_partial: Whether to allow partial validation; if `True` incomplete JSON will be parsed successfully
177177
and errors in the last element of sequences and mappings are ignored.
178178
`'trailing-strings'` means any final unfinished JSON string is included in the result.
179-
by_alias: Whether to use the field's alias to match the input data to an attribute.
180-
by_name: Whether to use the field's name to match the input data to an attribute.
179+
by_alias: Whether to use the field's alias when validating against the provided input data.
180+
by_name: Whether to use the field's name when validating against the provided input data.
181181
182182
Raises:
183183
ValidationError: If validation fails or if the JSON data is invalid.

python/pydantic_core/core_schema.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ class CoreConfig(TypedDict, total=False):
7272
regex_engine: The regex engine to use for regex pattern validation. Default is 'rust-regex'. See `StringSchema`.
7373
cache_strings: Whether to cache strings. Default is `True`, `True` or `'all'` is required to cache strings
7474
during general validation since validators don't know if they're in a key or a value.
75-
validate_by_alias: Whether to validate by alias. Default is `True`.
76-
validate_by_name: Whether to validate by attribute name. Default is `False`. Replacement for `populate_by_name`.
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`.
7777
serialize_by_alias: Whether to serialize by alias. Default is `False`, expected to change to `True` in V3.
7878
"""
7979

0 commit comments

Comments
 (0)