MCPcopy Create free account
hub / github.com/fastapi/fastapi / update_item

Function update_item

docs_src/body_multiple_params/tutorial001_py310.py:15–26  ·  view source on GitHub ↗
(
    *,
    item_id: int = Path(title="The ID of the item to get", ge=0, le=1000),
    q: str | None = None,
    item: Item | None = None,
)

Source from the content-addressed store, hash-verified

13
14@app.put("/items/{item_id}")
15async def update_item(
16 *,
17 item_id: int = Path(title="The ID of the item to get", ge=0, le=1000),
18 q: str | None = None,
19 item: Item | None = None,
20):
21 results = {"item_id": item_id}
22 if q:
23 results.update({"q": q})
24 if item:
25 results.update({"item": item})
26 return results

Callers

nothing calls this directly

Calls 1

PathClass · 0.90

Tested by

no test coverage detected