From 4aa3fa3cbb89744760c2a5e35314151fa6e89c60 Mon Sep 17 00:00:00 2001 From: Backend IM Bot Date: Fri, 28 Mar 2025 19:25:20 +0000 Subject: [PATCH] Update code in endpoints/fruits.get.py --- endpoints/fruits.get.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/endpoints/fruits.get.py b/endpoints/fruits.get.py index e69de29..bc24e30 100644 --- a/endpoints/fruits.get.py +++ b/endpoints/fruits.get.py @@ -0,0 +1,16 @@ +from fastapi import APIRouter, status +from typing import List +from schemas.fruit import FruitSchema + +router = APIRouter() + +@router.get("/fruits", status_code=status.HTTP_200_OK, response_model=List[FruitSchema]) +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 \ No newline at end of file