From c60badd01475fb70a1150793deee7b8f4dc3110c Mon Sep 17 00:00:00 2001 From: Alpha Date: Mon, 27 Jan 2025 15:06:54 +0000 Subject: [PATCH 1/2] docs: improve the doc for the customer from v2 library. --- docs/utilities/parser.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/utilities/parser.md b/docs/utilities/parser.md index a9433e123f9..93df4949369 100644 --- a/docs/utilities/parser.md +++ b/docs/utilities/parser.md @@ -259,6 +259,8 @@ If you run using a test event `{"message": "hello universe"}` you should expect `model_validator` can help when you have a complex validation mechanism. For example finding whether data has been omitted or comparing field values. +???+ tip For users of `root_validator` (deprecated as of version 3.0.0), it is recommended to use `model_validator` instead. + ```python title="model_validator.py" hl_lines="1 12-17" --8<-- "examples/parser/src/model_validator.py" ``` From 58d3b38ad3ebbdba7bd32a21f79a6829076596bc Mon Sep 17 00:00:00 2001 From: Alpha Date: Mon, 27 Jan 2025 16:30:44 +0000 Subject: [PATCH 2/2] docs: improve the doc from PR Co-authored-by: Leandro Damascena Signed-off-by: Alpha --- docs/utilities/parser.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/utilities/parser.md b/docs/utilities/parser.md index 93df4949369..1df9c2342f1 100644 --- a/docs/utilities/parser.md +++ b/docs/utilities/parser.md @@ -259,7 +259,7 @@ If you run using a test event `{"message": "hello universe"}` you should expect `model_validator` can help when you have a complex validation mechanism. For example finding whether data has been omitted or comparing field values. -???+ tip For users of `root_validator` (deprecated as of version 3.0.0), it is recommended to use `model_validator` instead. +!!! tip "If you are still using the deprecated `root_validator` function, switch to `model_validator` for the latest Pydantic functionality." ```python title="model_validator.py" hl_lines="1 12-17" --8<-- "examples/parser/src/model_validator.py"