Coverage for docs_src/body/tutorial001_py310.py: 100%
11 statements
« prev ^ index » next coverage.py v7.6.1, created at 2024-08-08 03:53 +0000
« prev ^ index » next coverage.py v7.6.1, created at 2024-08-08 03:53 +0000
1from fastapi import FastAPI 1abc
2from pydantic import BaseModel 1abc
5class Item(BaseModel): 1abc
6 name: str 1abc
7 description: str | None = None 1abc
8 price: float 1abc
9 tax: float | None = None 1abc
12app = FastAPI() 1abc
15@app.post("/items/") 1abc
16async def create_item(item: Item): 1abc
17 return item 1abc