fastapi-auth-middleware icon indicating copy to clipboard operation
fastapi-auth-middleware copied to clipboard

Integrate with fastapi openapi authentication

Open xtrm0 opened this issue 2 years ago • 0 comments

Is there a way to make this middleware correctly integrate with the openapi generators from fastapi? For instance. Currently, this:

@router.get("/me", response_model=schemas.User)
@requires('user')
async def read_user_me(request: Request, db: Session = Depends(get_db)):
  user = User.get_user(db, request.user.userid)
  return user

Is not detected by fastapi's openapi generator as an authenticated endpoint. Is there a way to make this library integrate correctly with the openapi generator.

image

xtrm0 avatar Nov 01 '22 18:11 xtrm0