fastapi/docs_src/body
Bharathis28 e0391ac7b5 Update Pydantic example in tutorial to Pydantic v2 syntax
This PR updates outdated code examples in body tutorial docs that still used Pydantic v1 patterns. Updated to Pydantic v2 syntax including:
- Replacing `.dict()` with `.model_dump()`
- Maintaining Python 3.10+ union types (`str | None`)

This ensures documentation is consistent with current FastAPI + Pydantic v2 behavior.
2025-12-01 11:07:17 +05:30
..
tutorial001.py 📝 Add docs recommending `Union` over `Optional` and migrate source examples (#4908) 2022-05-14 06:59:59 -05:00
tutorial001_py310.py Add docs and tests for Python 3.9 and Python 3.10 (#3712) 2022-01-07 15:11:31 +01:00
tutorial002.py 📝 Update Request Body's `tutorial002` to deal with `tax=0` case (#13230) 2025-01-30 12:19:10 +00:00
tutorial002_py310.py Update Pydantic example in tutorial to Pydantic v2 syntax 2025-12-01 11:07:17 +05:30
tutorial003.py 📝 Update code examples in docs for body, replace name `create_item` with `update_item` when appropriate (#5913) 2024-01-09 18:28:58 +04:00
tutorial003_py310.py Update Pydantic example in tutorial to Pydantic v2 syntax 2025-12-01 11:07:17 +05:30
tutorial004.py 📝 Update code examples in docs for body, replace name `create_item` with `update_item` when appropriate (#5913) 2024-01-09 18:28:58 +04:00
tutorial004_py310.py Update Pydantic example in tutorial to Pydantic v2 syntax 2025-12-01 11:07:17 +05:30