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

11 statements  

« prev     ^ index     » next       coverage.py v7.6.1, created at 2024-08-08 03:53 +0000

1from fastapi import FastAPI 1abcde

2 

3app = FastAPI() 1abcde

4 

5 

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

7async def read_items(): 1abcde

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

9 

10 

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

12async def read_users(): 1abcde

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

14 

15 

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

17async def read_elements(): 1abcde

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