fastapi/docs_src/query_params_str_validations/tutorial011_py39.py
Sebastián Ramírez d08a062ee2
Add docs and tests for Python 3.9 and Python 3.10 (#3712)
Co-authored-by: Thomas Grainger <tagrain@gmail.com>
2022-01-07 15:11:31 +01:00

11 lines
213 B
Python

from typing import Optional
from fastapi import FastAPI, Query
app = FastAPI()
@app.get("/items/")
async def read_items(q: Optional[list[str]] = Query(None)):
query_items = {"q": q}
return query_items