📝 Move tutorial src files to top level docs

This commit is contained in:
Sebastián Ramírez
2018-12-21 16:22:33 +04:00
parent d5e782074f
commit 0a65c41909
132 changed files with 134 additions and 422 deletions

View File

@@ -0,0 +1,22 @@
from fastapi import FastAPI, Query
app = FastAPI()
@app.get("/items/")
async def read_items(
q: str = Query(
None,
alias="item-query",
title="Query string",
description="Query string for the items to search in the database that have a good match",
min_length=3,
max_length=50,
regex="^fixedquery$",
deprecated=True,
)
):
results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]}
if q:
results.update({"q": q})
return results