Skip to content

Commit

Permalink
docs: apply suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
benbenbang committed Aug 14, 2023
1 parent 1e6cae4 commit 15e7142
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/migration.md
Expand Up @@ -239,7 +239,7 @@ See [Model Config](usage/model_config.md) for more details.
example, despite the fact that the validator below will never error, the following code raises a `ValidationError`:

!!! note
To avoid this, you can use the `validate_default` argument in the `Field` function. When set to `True`, it mimics the behavior of `always=True` in pydantic v1. However, the new way of using `validate_default` is encouraged as it provides more flexibility and control.
To avoid this, you can use the `validate_default` argument in the `Field` function. When set to `True`, it mimics the behavior of `always=True` in Pydantic v1. However, the new way of using `validate_default` is encouraged as it provides more flexibility and control.


```python test="skip"
Expand Down
2 changes: 1 addition & 1 deletion docs/usage/validators.md
Expand Up @@ -266,7 +266,7 @@ print(context['logs'])

Validators won't run when the default value is used.
This applies both to `@field_validator` validators and `Annotated` validators.
You can force them to run with `Field(validate_defaults=True)`. Setting `validate_default` to `True` has the closest behavior to using `always=True` in `validator` in pydantic v1. However, you are generally better off using a `@model_validator(mode='before')` where the function is called before the inner validator is called.
You can force them to run with `Field(validate_defaults=True)`. Setting `validate_default` to `True` has the closest behavior to using `always=True` in `validator` in Pydantic v1. However, you are generally better off using a `@model_validator(mode='before')` where the function is called before the inner validator is called.


```py
Expand Down

0 comments on commit 15e7142

Please sign in to comment.