Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. # body - https://fastapi.tiangolo.com/tutorial/body-multiple-params/#embed-a-single-body-parameter ### embed ```python @app.put("/items/{item_id}") async def update_item(*, item_id: int, item: Item = Body(..., embed=True)): results = {"item_id": item_id, "item": item} return results ``` ```python { "item": { "name": "Foo", "description": "The pretender", "price": 42.0, "tax": 3.2 } } ``` embed=False ```python { "name": "Foo", "description": "The pretender", "price": 42.0, "tax": 3.2 } ``` open/fastapi-body.txt Last modified: 2024/10/05 06:15by 127.0.0.1