Updated OAuth2 router generator for better OpenAPI docs (#793)

* Added OAuth2 authorize route response_model

* Changed OAuth2 "authorize" route backend param type.

On OAuth2 router creation, an enum is created for the `authentication_backend` parameter. This allows us to generate OpenAPI docs correctly.

* Reformatted with "make format"

* Updated OAuth2 authorize url docs

- /authorize now returns 422 instead of 400 for an invalid authentication backend
This commit is contained in:
Matyáš Richter
2021-11-10 07:55:40 +01:00
committed by GitHub
parent 4aef8f8a17
commit f578a01a8b
4 changed files with 19 additions and 15 deletions

View File

@ -79,3 +79,7 @@ class BaseOAuthAccountMixin(BaseModel):
"""Adds OAuth accounts list to a User model."""
oauth_accounts: List[BaseOAuthAccount] = []
class OAuth2AuthorizeResponse(BaseModel):
authorization_url: str