fastapi-auth-middleware
fastapi-auth-middleware copied to clipboard
Integrate with fastapi openapi authentication
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.