From faa912d53de5843d333532c810c239b7cc9bd391 Mon Sep 17 00:00:00 2001 From: msrajput08 Date: Sat, 27 Sep 2025 16:55:14 +0530 Subject: [PATCH] Add missing response_model type hint in example route --- docs/msr/first-steps.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 docs/msr/first-steps.md diff --git a/docs/msr/first-steps.md b/docs/msr/first-steps.md new file mode 100644 index 000000000..e48064bb6 --- /dev/null +++ b/docs/msr/first-steps.md @@ -0,0 +1,13 @@ +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}]