18 lines
341 B
Python
18 lines
341 B
Python
import uuid
|
|
|
|
from pydantic import BaseModel, Field
|
|
|
|
|
|
class RegisterRequest(BaseModel):
|
|
username: str = Field(min_length=3, max_length=32)
|
|
password: str = Field(min_length=8, max_length=128)
|
|
email: str | None = None
|
|
|
|
|
|
class UserOut(BaseModel):
|
|
id: uuid.UUID
|
|
username: str
|
|
|
|
class Config:
|
|
from_attributes = True
|