mirror of
https://github.com/fastapi/fastapi.git
synced 2026-05-05 14:16:20 -04:00
📝 Use return type annotation instead of response_model when possible (#14753)
This commit is contained in:
@@ -159,8 +159,8 @@ async def login_for_access_token(
|
||||
return Token(access_token=access_token, token_type="bearer")
|
||||
|
||||
|
||||
@app.get("/users/me/", response_model=User)
|
||||
async def read_users_me(current_user: User = Depends(get_current_active_user)):
|
||||
@app.get("/users/me/")
|
||||
async def read_users_me(current_user: User = Depends(get_current_active_user)) -> User:
|
||||
return current_user
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user