-
Notifications
You must be signed in to change notification settings - Fork 0
Dev2 #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Dev2 #2
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -20,6 +20,15 @@ def custom_generate_unique_id(route: APIRoute) -> str: | |||
| generate_unique_id_function=custom_generate_unique_id, | ||||
| ) | ||||
|
|
||||
| class User(BaseModel): | ||||
| username: str | ||||
|
|
||||
| user_dependency = User(username="admin") | ||||
|
|
||||
| @app.get("/broken-endpoint") | ||||
| def read_user(user: User = Depends(user_dependency)): | ||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This change breaks 1 usages of Symbol:
|
||||
| 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)
There was a problem hiding this comment.
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
BaseModelacross 1 filesSymbol:
BaseModelClass 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
FastAPI-project/backend/app/main.py
Line 23 in 23ccb42