Automated Action 959ebdf9a5 Create simple Todo API application with FastAPI and SQLite
generated with BackendIM... (backend.im)
2025-05-12 23:20:38 +00:00

22 lines
495 B
Python

from pydantic import BaseModel, Field
from typing import Optional
from datetime import datetime
class TodoBase(BaseModel):
title: str = Field(..., min_length=1, max_length=100)
description: Optional[str] = None
completed: bool = False
class TodoCreate(TodoBase):
pass
class TodoResponse(TodoBase):
id: int
created_at: datetime
updated_at: Optional[datetime] = None
class Config:
from_attributes = True
class HealthResponse(BaseModel):
status: str