Update code in endpoints/fruits.get.py
This commit is contained in:
parent
3682f796e4
commit
4aa3fa3cbb
@ -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
|
Loading…
x
Reference in New Issue
Block a user