from fastapi import APIRouter, Depends from sqlalchemy.orm import Session from typing import List from core.database import get_db from schemas.fruit import FruitSchema from helpers.fruit_helpers import get_all_fruits router = APIRouter() @router.get("/fruits", response_model=List[FruitSchema]) async def get_fruits(db: Session = Depends(get_db)): fruits = get_all_fruits(db) # The color property should already be part of the Fruit model and FruitSchema return fruits