Coverage for docs_src / body / tutorial001_py310.py: 100%

11 statements  

« prev     ^ index     » next       coverage.py v7.13.3, created at 2026-04-06 01:24 +0000

1from fastapi import FastAPI 1abfgcde

2from pydantic import BaseModel 1abfgcde

3 

4 

5class Item(BaseModel): 1abfgcde

6 name: str 1abcde

7 description: str | None = None 1abfgcde

8 price: float 1abcde

9 tax: float | None = None 1abfgcde

10 

11 

12app = FastAPI() 1abfgcde

13 

14 

15@app.post("/items/") 1abfgcde

16async def create_item(item: Item): 1abfgcde

17 return item 1hijklmnopqrstuvwxyzA