Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions backend/app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@ def custom_generate_unique_id(route: APIRoute) -> str:
generate_unique_id_function=custom_generate_unique_id,
)

class User(BaseModel):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change breaks 1 usages of BaseModel across 1 files

Symbol: BaseModel

Class User inherits from BaseModel but BaseModel is not imported from pydantic, which will cause a NameError at runtime. Add 'from pydantic import BaseModel' to fix this issue.

Affected locations

class User(BaseModel):


React with 👍 to tell me that this comment was useful, or 👎 if not (and I'll stop posting more comments like this in the future)

username: str

user_dependency = User(username="admin")

@app.get("/broken-endpoint")
def read_user(user: User = Depends(user_dependency)):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change breaks 1 usages of Depends across 1 files

Symbol: Depends

Function read_user uses Depends but Depends is not imported from fastapi, which will cause a NameError at runtime. Add 'from fastapi import Depends' to fix this issue.

Affected locations

def read_user(user: User = Depends(user_dependency)):


React with 👍 to tell me that this comment was useful, or 👎 if not (and I'll stop posting more comments like this in the future)

return {"user": user}

# Set all CORS enabled origins
if settings.all_cors_origins:
app.add_middleware(
Expand Down