Coverage for docs_src/path_operation_configuration/tutorial002b.py: 100%
12 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 enum import Enum 1abcde
3from fastapi import FastAPI 1abcde
5app = FastAPI() 1abcde
8class Tags(Enum): 1abcde
9 items = "items" 1abcde
10 users = "users" 1abcde
13@app.get("/items/", tags=[Tags.items]) 1abcde
14async def get_items(): 1abcde
15 return ["Portal gun", "Plumbus"] 1abcde
18@app.get("/users/", tags=[Tags.users]) 1abcde
19async def read_users(): 1abcde
20 return ["Rick", "Morty"] 1abcde