You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

271 B

from typing import List from fastapi import FastAPI from pydantic import BaseModel

class Item(BaseModel): name: str price: float

app = FastAPI()

@app.get("/items/", response_model=List[Item]) async def read_items(): return [{"name": "Foo", "price": 50.2}]