From 4584f706bdf833ede7e6d5771c0d16bb9c01fafd Mon Sep 17 00:00:00 2001 From: Jom Karlo Verzosa Date: Sun, 31 Aug 2025 18:58:56 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20Add=20deprecation=20info=20block?= =?UTF-8?q?=20about=20`dict()`=20in=20`docs/tutorial/body.md`=20(#13906)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sebastián Ramírez --- docs/en/docs/tutorial/body.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/en/docs/tutorial/body.md b/docs/en/docs/tutorial/body.md index 58e20f4c9..a820802f7 100644 --- a/docs/en/docs/tutorial/body.md +++ b/docs/en/docs/tutorial/body.md @@ -128,6 +128,14 @@ Inside of the function, you can access all the attributes of the model object di {* ../../docs_src/body/tutorial002_py310.py *} +/// info + +In Pydantic v1 the method was called `.dict()`, it was deprecated (but still supported) in Pydantic v2, and renamed to `.model_dump()`. + +The examples here use `.dict()` for compatibility with Pydantic v1, but you should use `.model_dump()` instead if you can use Pydantic v2. + +/// + ## Request body + path parameters { #request-body-path-parameters } You can declare path parameters and request body at the same time.