]> git.ipfire.org Git - thirdparty/fastapi/fastapi.git/commitdiff
:bug: Fix int query parameters with default
authorSebastián Ramírez <tiangolo@gmail.com>
Mon, 10 Dec 2018 14:08:08 +0000 (18:08 +0400)
committerSebastián Ramírez <tiangolo@gmail.com>
Mon, 10 Dec 2018 14:08:08 +0000 (18:08 +0400)
being treated as body

fastapi/__init__.py
fastapi/dependencies/utils.py

index 1275415fae108e99b28a86928848b4f57d9886b9..fc4a08aeca232a995df931cfd426b0060c2d9f67 100644 (file)
@@ -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
index d91c832551bc718bd33976771c86835f3237dabb..969acd3e63e50d61d4857ec28a43e2e8abaa364a 100644 (file)
@@ -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)
         ):