mirror of
https://github.com/grillazz/fastapi-sqlalchemy-asyncpg.git
synced 2025-11-30 13:20:40 +03:00
code format
This commit is contained in:
@@ -8,10 +8,20 @@ config = ConfigDict(from_attributes=True)
|
||||
# TODO: add pydantic field validator for strong password
|
||||
class UserSchema(BaseModel):
|
||||
model_config = config
|
||||
email: EmailStr = Field(title="User’s email", description="User’s email", examples=["john@domain.com"])
|
||||
first_name: str = Field(title="User’s first name", description="User’s first name", examples=["John"])
|
||||
last_name: str = Field(title="User’s last name", description="User’s last name", examples=["Doe"])
|
||||
password: SecretStr = Field(title="User’s password", description="User’s password", examples=["@SuperSecret123"])
|
||||
email: EmailStr = Field(
|
||||
title="User’s email", description="User’s email", examples=["john@domain.com"]
|
||||
)
|
||||
first_name: str = Field(
|
||||
title="User’s first name", description="User’s first name", examples=["John"]
|
||||
)
|
||||
last_name: str = Field(
|
||||
title="User’s last name", description="User’s last name", examples=["Doe"]
|
||||
)
|
||||
password: SecretStr = Field(
|
||||
title="User’s password",
|
||||
description="User’s password",
|
||||
examples=["@SuperSecret123"],
|
||||
)
|
||||
|
||||
|
||||
class UserResponse(BaseModel):
|
||||
@@ -23,11 +33,19 @@ class UserResponse(BaseModel):
|
||||
|
||||
|
||||
class TokenResponse(BaseModel):
|
||||
access_token: str = Field(title="User’s access token", description="User’s access token")
|
||||
access_token: str = Field(
|
||||
title="User’s access token", description="User’s access token"
|
||||
)
|
||||
token_type: str = Field(title="User’s token type", description="User’s token type")
|
||||
|
||||
|
||||
class UserLogin(BaseModel):
|
||||
model_config = config
|
||||
email: EmailStr = Field(title="User’s email", description="User’s email", examples=["john@domain.com"])
|
||||
password: SecretStr = Field(title="User’s password", description="User’s password", examples=["@SuperSecret123"])
|
||||
email: EmailStr = Field(
|
||||
title="User’s email", description="User’s email", examples=["john@domain.com"]
|
||||
)
|
||||
password: SecretStr = Field(
|
||||
title="User’s password",
|
||||
description="User’s password",
|
||||
examples=["@SuperSecret123"],
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user