fix(schemas): Make user info fields optional to handle different account types
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
from pydantic import BaseModel, Field
|
from pydantic import BaseModel, Field
|
||||||
|
from typing import Optional
|
||||||
|
|
||||||
class TokenRequest(BaseModel):
|
class TokenRequest(BaseModel):
|
||||||
"""Схема запроса для получения токена."""
|
"""Схема запроса для получения токена."""
|
||||||
@@ -13,5 +14,7 @@ class UserInfoResponse(BaseModel):
|
|||||||
"""Схема ответа с информацией о пользователе Яндекса."""
|
"""Схема ответа с информацией о пользователе Яндекса."""
|
||||||
id: str
|
id: str
|
||||||
login: str
|
login: str
|
||||||
display_name: str
|
# Делаем эти поля необязательными. Если Яндекс их не пришлет,
|
||||||
default_email: str
|
# они будут иметь значение None, и ошибки валидации не будет.
|
||||||
|
display_name: Optional[str] = None
|
||||||
|
default_email: Optional[str] = None
|
||||||
Reference in New Issue
Block a user