Home / Function/ get_item() — fastapi Function Reference

get_item() — fastapi Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  b360c629_6333_d129_6f50_6afb95257ca8["get_item()"]
  2e574f27_37b3_df7a_681f_ffe639a3918c["tutorial008d_py39.py"]
  b360c629_6333_d129_6f50_6afb95257ca8 -->|defined in| 2e574f27_37b3_df7a_681f_ffe639a3918c
  style b360c629_6333_d129_6f50_6afb95257ca8 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

docs_src/dependencies/tutorial008d_py39.py lines 19–28

def get_item(item_id: str, username: 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/tutorial008d_py39.py.
Where is get_item() defined?
get_item() is defined in docs_src/dependencies/tutorial008d_py39.py at line 19.

Analyze Your Own Codebase

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

Try Supermodel Free