diff --git a/openapi_core/wrappers.py b/openapi_core/wrappers.py index 342e857..fbd5486 100644 --- a/openapi_core/wrappers.py +++ b/openapi_core/wrappers.py @@ -70,7 +70,7 @@ class RequestParametersFactory(BaseRequestFactory): if param.required: raise - if not param.schema or not param.schema.default: + if not param.schema or param.schema.default is None: continue raw_value = param.schema.default diff --git a/tests/integration/data/v3.0/petstore.yaml b/tests/integration/data/v3.0/petstore.yaml index 21d0bf9..f7a81ac 100644 --- a/tests/integration/data/v3.0/petstore.yaml +++ b/tests/integration/data/v3.0/petstore.yaml @@ -34,6 +34,13 @@ paths: type: integer format: int32 nullable: true + - name: search + in: query + description: Search query + schema: + type: string + default: "" + allowEmptyValue: true - name: ids in: query description: Filter pets with Ids diff --git a/tests/integration/test_petstore.py b/tests/integration/test_petstore.py index e80c344..d4798fd 100644 --- a/tests/integration/test_petstore.py +++ b/tests/integration/test_petstore.py @@ -137,6 +137,7 @@ class TestPetstore(object): 'query': { 'limit': 20, 'page': 1, + 'search': '', 'ids': [12, 13], } } @@ -212,6 +213,7 @@ class TestPetstore(object): 'query': { 'limit': None, 'page': 1, + 'search': '', } }