Home / Function/ create_item() — fastapi Function Reference

create_item() — fastapi Function Reference

Architecture documentation for the create_item() function in tutorial002_py310.py from the fastapi codebase.

Entity Profile

Dependency Diagram

graph TD
  8384027c_b3f3_a5f1_a559_a11229aa7fd5["create_item()"]
  caf169d5_1935_b26f_036d_6b91b573c0a0["tutorial002_py310.py"]
  8384027c_b3f3_a5f1_a559_a11229aa7fd5 -->|defined in| caf169d5_1935_b26f_036d_6b91b573c0a0
  style 8384027c_b3f3_a5f1_a559_a11229aa7fd5 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

docs_src/body/tutorial002_py310.py lines 16–21

async def create_item(item: Item):
    item_dict = item.model_dump()
    if item.tax is not None:
        price_with_tax = item.price + item.tax
        item_dict.update({"price_with_tax": price_with_tax})
    return item_dict

Domain

Subdomains

Frequently Asked Questions

What does create_item() do?
create_item() is a function in the fastapi codebase, defined in docs_src/body/tutorial002_py310.py.
Where is create_item() defined?
create_item() is defined in docs_src/body/tutorial002_py310.py at line 16.

Analyze Your Own Codebase

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

Try Supermodel Free