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}]