from fastapi import APIRouter, status from typing import List router = APIRouter() @router.get("/fruits", status_code=status.HTTP_200_OK) async def get_fruits(): fruits = [ {"name": "Apple", "color": "Red"}, {"name": "Banana", "color": "Yellow"}, {"name": "Orange", "color": "Orange"}, {"name": "Grape", "color": "Purple"}, {"name": "Kiwi", "color": "Brown"} ] return fruits