Coverage for docs_src/extra_models/tutorial004_py39.py: 100%

10 statements  

« prev     ^ index     » next       coverage.py v7.6.1, created at 2025-12-04 08:29 +0000

1from fastapi import FastAPI 1abcdef

2from pydantic import BaseModel 1abcdef

3 

4app = FastAPI() 1abcdef

5 

6 

7class Item(BaseModel): 1abcdef

8 name: str 1abcdef

9 description: str 1abcdef

10 

11 

12items = [ 1abcdef

13 {"name": "Foo", "description": "There comes my hero"}, 

14 {"name": "Red", "description": "It's my aeroplane"}, 

15] 

16 

17 

18@app.get("/items/", response_model=list[Item]) 1abcdef

19async def read_items(): 1abcdef

20 return items 1ghijkl