Coverage for docs_src / path_operation_configuration / tutorial006_py310.py: 100%

11 statements  

« prev     ^ index     » next       coverage.py v7.13.3, created at 2026-02-12 18:15 +0000

1from fastapi import FastAPI 1abcd

2 

3app = FastAPI() 1abcd

4 

5 

6@app.get("/items/", tags=["items"]) 1abcd

7async def read_items(): 1abcd

8 return [{"name": "Foo", "price": 42}] 1efg

9 

10 

11@app.get("/users/", tags=["users"]) 1abcd

12async def read_users(): 1abcd

13 return [{"username": "johndoe"}] 1efg

14 

15 

16@app.get("/elements/", tags=["items"], deprecated=True) 1abcd

17async def read_elements(): 1abcd

18 return [{"item_id": "Foo"}] 1efg