From: Sebastián Ramírez Date: Mon, 10 Dec 2018 14:08:08 +0000 (+0400) Subject: :bug: Fix int query parameters with default X-Git-Tag: 0.1.11~55 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6f68666e0eafefe1d45564f688f33750b4fdfa64;p=thirdparty%2Ffastapi%2Ffastapi.git :bug: Fix int query parameters with default being treated as body --- diff --git a/fastapi/__init__.py b/fastapi/__init__.py index 1275415fae..fc4a08aeca 100644 --- a/fastapi/__init__.py +++ b/fastapi/__init__.py @@ -1,6 +1,6 @@ """FastAPI framework, high performance, easy to learn, fast to code, ready for production""" -__version__ = "0.1.5" +__version__ = "0.1.6" from .applications import FastAPI from .routing import APIRouter diff --git a/fastapi/dependencies/utils.py b/fastapi/dependencies/utils.py index d91c832551..969acd3e63 100644 --- a/fastapi/dependencies/utils.py +++ b/fastapi/dependencies/utils.py @@ -82,7 +82,11 @@ def get_dependant(*, path: str, call: Callable, name: str = None) -> Dependant: default_schema=params.Path, force_type=params.ParamTypes.path, ) - elif (param.default == param.empty or param.default is None) and ( + elif ( + param.default == param.empty + or param.default is None + or type(param.default) in param_supported_types + ) and ( param.annotation == param.empty or lenient_issubclass(param.annotation, param_supported_types) ):