mirror of
https://github.com/rjNemo/fastapi
synced 2026-06-07 19:16:43 +00:00
* 🐛 Fix path and query parameters accepting dict * ✅ Add several tests to ensure invalid types are not accepted * 📝 Document (to include tested source) using query params with list * 🐛 Fix OpenAPI schema in query with list tutorial
9 lines
169 B
Python
9 lines
169 B
Python
from fastapi import FastAPI, Query
|
|
|
|
app = FastAPI()
|
|
|
|
|
|
@app.get("/items/")
|
|
async def read_items(q: list = Query(None)):
|
|
query_items = {"q": q}
|
|
return query_items
|