Home / Function/ get_item() — fastapi Function Reference

get_item() — fastapi Function Reference

Architecture documentation for the get_item() function in tutorial008c_an_py39.py from the fastapi codebase.

Entity Profile

Dependency Diagram

graph TD
  f440fb8e_63b2_1bd4_9a51_b187e05d2719["get_item()"]
  2875ca54_4ac4_a938_0063_fb50a19c2f32["tutorial008c_an_py39.py"]
  f440fb8e_63b2_1bd4_9a51_b187e05d2719 -->|defined in| 2875ca54_4ac4_a938_0063_fb50a19c2f32
  style f440fb8e_63b2_1bd4_9a51_b187e05d2719 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

docs_src/dependencies/tutorial008c_an_py39.py lines 20–29

def get_item(item_id: str, username: Annotated[str, Depends(get_username)]):
    if item_id == "portal-gun":
        raise InternalError(
            f"The portal gun is too dangerous to be owned by {username}"
        )
    if item_id != "plumbus":
        raise HTTPException(
            status_code=404, detail="Item not found, there's only a plumbus here"
        )
    return item_id

Domain

Subdomains

Frequently Asked Questions

What does get_item() do?
get_item() is a function in the fastapi codebase, defined in docs_src/dependencies/tutorial008c_an_py39.py.
Where is get_item() defined?
get_item() is defined in docs_src/dependencies/tutorial008c_an_py39.py at line 20.

Analyze Your Own Codebase

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

Try Supermodel Free