from pydantic import BaseModel, Field from typing import List, Optional from uuid import UUID from datetime import datetime class FruitNamesResponse(BaseModel): names: List[str] = Field(..., description="List of fruit names") class Config: schema_extra = { "example": { "names": ["Apple", "Banana", "Orange"] } } # Note: Keeping the original schemas in case they're still needed elsewhere in the application class FruitBase(BaseModel): name: str = Field(..., min_length=1, description="Fruit name") class FruitCreate(FruitBase): pass class FruitUpdate(BaseModel): name: Optional[str] = Field(None, min_length=1, description="Fruit name") class FruitSchema(FruitBase): id: UUID created_at: datetime updated_at: datetime class Config: orm_mode = True schema_extra = { "example": { "id": "f47ac10b-58cc-4372-a567-0e02b2c3d479", "name": "Apple", "created_at": "2023-01-01T12:00:00", "updated_at": "2023-01-01T12:00:00" } }