From 71deb096e4558422c1f0a995aabc25b9ffbac8e8 Mon Sep 17 00:00:00 2001 From: Louis Maddox Date: Wed, 23 Aug 2023 17:36:49 +0100 Subject: [PATCH] fix #7228 (typo): docs in `validators.md` to correct `validate_default` kwarg (#7229) --- docs/usage/validators.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/usage/validators.md b/docs/usage/validators.md index 5c2e44eabf..074d761b6b 100644 --- a/docs/usage/validators.md +++ b/docs/usage/validators.md @@ -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