Skip to content

Commit 425ebbe

Browse files
committed
📝 Add deprecated info for dict() in Request Body
1 parent 27f4240 commit 425ebbe

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

‎docs/en/docs/tutorial/body.md‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,14 @@ Inside of the function, you can access all the attributes of the model object di
128128

129129
{* ../../docs_src/body/tutorial002_py310.py *}
130130

131+
/// info
132+
133+
In Pydantic v1 the method was called `.dict()`, it was deprecated (but still supported) in Pydantic v2, and renamed to `.model_dump()`.
134+
135+
The examples here use `.dict()` for compatibility with Pydantic v1, but you should use `.model_dump()` instead if you can use Pydantic v2.
136+
137+
///
138+
131139
## Request body + path parameters
132140

133141
You can declare path parameters and request body at the same time.

0 commit comments

Comments
 (0)