mirror of
https://github.com/fastapi/fastapi.git
synced 2026-02-26 19:57:59 -05:00
🚚 Re-sort tutorial example files
This commit is contained in:
@@ -4,11 +4,7 @@ app = FastAPI()
|
||||
|
||||
|
||||
@app.get("/items/")
|
||||
async def read_items(
|
||||
q: str = Query(
|
||||
None, title="Query string", min_length=3, max_length=50, regex="^fixedquery$"
|
||||
)
|
||||
):
|
||||
async def read_items(q: str = Query(None, min_length=3, max_length=50, regex="^fixedquery$")):
|
||||
results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]}
|
||||
if q:
|
||||
results.update({"q": q})
|
||||
|
||||
Reference in New Issue
Block a user