Files
torrent_backend/database/schemas/users.py
2024-05-14 20:55:35 +04:00

20 lines
485 B
Python

from typing import Optional
from fastapi import Body
from pydantic import BaseModel, ConfigDict, Field
class UserBase(BaseModel):
email: str = Field(examples=["email@gmail.com"])
name: str = Field(examples=["username"])
class UserCreate(UserBase):
password: str = Field(examples=["password"])
class User(UserBase):
id: int = Field(examples=[1])
hash_of_password: str = Field(examples=["hash_of_password"])
model_config = ConfigDict(from_attributes=True)