-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #142 from grillazz/refactor
Refactor
- Loading branch information
Showing
7 changed files
with
350 additions
and
143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
from uuid import UUID | ||
|
||
from pydantic import BaseModel, Field, EmailStr, ConfigDict | ||
from pydantic import BaseModel, Field, EmailStr, ConfigDict, SecretStr | ||
|
||
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") | ||
first_name: str = Field(title="User’s first name", description="User’s first name") | ||
last_name: str = Field(title="User’s last name", description="User’s last name") | ||
password: str = Field(title="User’s password", description="User’s password") | ||
email: EmailStr = Field(title="User’s email", description="User’s email", examples=["[email protected]"]) | ||
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): | ||
|
@@ -29,5 +29,5 @@ class TokenResponse(BaseModel): | |
|
||
class UserLogin(BaseModel): | ||
model_config = config | ||
email: EmailStr = Field(title="User’s email", description="User’s email") | ||
password: str = Field(title="User’s password", description="User’s password") | ||
email: EmailStr = Field(title="User’s email", description="User’s email", examples=["[email protected]"]) | ||
password: SecretStr = Field(title="User’s password", description="User’s password", examples=["@SuperSecret123"]) |
Oops, something went wrong.