mirror of https://github.com/tiangolo/fastapi.git
use mapping type
This commit is contained in:
parent
b092a0be32
commit
279285e4ec
|
|
@ -1,5 +1,5 @@
|
||||||
import http
|
import http
|
||||||
from typing import FrozenSet, Optional
|
from typing import FrozenSet, Mapping, Optional
|
||||||
|
|
||||||
from fastapi import FastAPI, Path, Query
|
from fastapi import FastAPI, Path, Query
|
||||||
|
|
||||||
|
|
@ -190,7 +190,7 @@ def get_query_param_required_type(query: int = Query()):
|
||||||
|
|
||||||
|
|
||||||
@app.get("/query/params")
|
@app.get("/query/params")
|
||||||
def get_query_params(queries: Dict[str, int] = Query({})):
|
def get_query_params(queries: Mapping[str, int] = Query({})):
|
||||||
return f"foo bar {queries}"
|
return f"foo bar {queries}"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue