mirror of
https://github.com/fastapi/fastapi.git
synced 2026-10-09 11:41:39 -04:00
📝 Move tutorial src files to top level docs
This commit is contained in:
1 parent
d5e782074f
commit
0a65c41909
132 files changed
+134
-422
No files matched your search
@@ -0,0 +1,15 @@
|
||||
from fastapi import FastAPI
|
||||
|
||||
app = FastAPI()
|
||||
|
||||
|
||||
@app.get("/items/{item_id}")
|
||||
async def read_item(item_id: str, q: str = None, short: bool = False):
|
||||
item = {"item_id": item_id}
|
||||
if q:
|
||||
item.update({"q": q})
|
||||
if not short:
|
||||
item.update(
|
||||
{"description": "This is an amazing item that has a long description"}
|
||||
)
|
||||
return item
|
||||
Reference in new issue
Block a user