Skip to content

Commit

Permalink
fix #7228 (typo): docs in validators.md to correct `validate_defaul…
Browse files Browse the repository at this point in the history
…t` kwarg (#7229)
  • Loading branch information
lmmx committed Aug 23, 2023
1 parent d110b47 commit 71deb09
Showing 1 changed file with 1 addition and 1 deletion.
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_default=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 71deb09

Please sign in to comment.