mirror of
https://github.com/DarrylNixon/ghostforge
synced 2024-04-22 06:27:20 -07:00
27 lines
669 B
Python
27 lines
669 B
Python
import datetime
|
|
|
|
from pydantic import BaseModel
|
|
from pydantic import Field
|
|
|
|
|
|
class UserSchema(BaseModel):
|
|
name: str = Field(...)
|
|
password: str = Field(...)
|
|
created: datetime.datetime = datetime.datetime
|
|
|
|
class Config:
|
|
schema_extra = {
|
|
"example": {
|
|
"name": "Jeremy Tootsieroll",
|
|
"password": "notarealpassword",
|
|
"created": "2021-03-05T08:21:00.000Z",
|
|
}
|
|
}
|
|
|
|
|
|
class UserLoginSchema(BaseModel):
|
|
name: str = Field(...)
|
|
password: str = Field(...)
|
|
|
|
class Config:
|
|
schema_extra = {"example": {"name": "Jeremy Tootsieroll", "password": "notarealpassword"}}
|