mirror of
https://github.com/fastapi/fastapi.git
synced 2026-03-31 13:11:17 -04:00
📝 Update code examples in docs for body, replace name create_item with update_item when appropriate (#5913)
This commit is contained in:
@@ -13,7 +13,7 @@ app = FastAPI()
|
||||
|
||||
|
||||
@app.put("/items/{item_id}")
|
||||
async def create_item(item_id: int, item: Item, q: str | None = None):
|
||||
async def update_item(item_id: int, item: Item, q: str | None = None):
|
||||
result = {"item_id": item_id, **item.dict()}
|
||||
if q:
|
||||
result.update({"q": q})
|
||||
|
||||
Reference in New Issue
Block a user