Home / Function/ update_item() — fastapi Function Reference

update_item() — fastapi Function Reference

Architecture documentation for the update_item() function in tutorial005_py310.py from the fastapi codebase.

Entity Profile

Dependency Diagram

graph TD
  15127a14_984b_05e1_9b06_5c76ecd87e29["update_item()"]
  fc1b407f_bb6f_1632_89ae_8d73c4c8e29c["tutorial005_py310.py"]
  15127a14_984b_05e1_9b06_5c76ecd87e29 -->|defined in| fc1b407f_bb6f_1632_89ae_8d73c4c8e29c
  style 15127a14_984b_05e1_9b06_5c76ecd87e29 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

docs_src/schema_extra_example/tutorial005_py310.py lines 15–49

async def update_item(
    *,
    item_id: int,
    item: Item = Body(
        openapi_examples={
            "normal": {
                "summary": "A normal example",
                "description": "A **normal** item works correctly.",
                "value": {
                    "name": "Foo",
                    "description": "A very nice Item",
                    "price": 35.4,
                    "tax": 3.2,
                },
            },
            "converted": {
                "summary": "An example with converted data",
                "description": "FastAPI can convert price `strings` to actual `numbers` automatically",
                "value": {
                    "name": "Bar",
                    "price": "35.4",
                },
            },
            "invalid": {
                "summary": "Invalid data is rejected with an error",
                "value": {
                    "name": "Baz",
                    "price": "thirty five point four",
                },
            },
        },
    ),
):
    results = {"item_id": item_id, "item": item}
    return results

Domain

Subdomains

Frequently Asked Questions

What does update_item() do?
update_item() is a function in the fastapi codebase, defined in docs_src/schema_extra_example/tutorial005_py310.py.
Where is update_item() defined?
update_item() is defined in docs_src/schema_extra_example/tutorial005_py310.py at line 15.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free