mirror of
https://github.com/fastapi/fastapi.git
synced 2026-10-22 09:55:32 -04:00
📝 Add docs for path operation configurations
This commit is contained in:
1 parent
8628120873
commit
e790bf6f1b
13 files changed
+246
No files matched your search
@@ -0,0 +1,18 @@
|
||||
from fastapi import FastAPI
|
||||
|
||||
app = FastAPI()
|
||||
|
||||
|
||||
@app.get("/items/", tags=["items"])
|
||||
async def read_items():
|
||||
return [{"name": "Foo", "price": 42}]
|
||||
|
||||
|
||||
@app.get("/users/", tags=["users"])
|
||||
async def read_users():
|
||||
return [{"username": "johndoe"}]
|
||||
|
||||
|
||||
@app.get("/elements/", tags=["items"], deprecated=True)
|
||||
async def read_elements():
|
||||
return [{"item_id": "Foo"}]
|
||||
Reference in new issue
Block a user