Allow empty value with default

This commit is contained in:
Artur Maciag 2017-10-19 12:28:28 +01:00
parent 9cf677eb46
commit 372f74f16e
3 changed files with 10 additions and 1 deletions

View file

@ -70,7 +70,7 @@ class RequestParametersFactory(BaseRequestFactory):
if param.required: if param.required:
raise raise
if not param.schema or not param.schema.default: if not param.schema or param.schema.default is None:
continue continue
raw_value = param.schema.default raw_value = param.schema.default

View file

@ -34,6 +34,13 @@ paths:
type: integer type: integer
format: int32 format: int32
nullable: true nullable: true
- name: search
in: query
description: Search query
schema:
type: string
default: ""
allowEmptyValue: true
- name: ids - name: ids
in: query in: query
description: Filter pets with Ids description: Filter pets with Ids

View file

@ -137,6 +137,7 @@ class TestPetstore(object):
'query': { 'query': {
'limit': 20, 'limit': 20,
'page': 1, 'page': 1,
'search': '',
'ids': [12, 13], 'ids': [12, 13],
} }
} }
@ -212,6 +213,7 @@ class TestPetstore(object):
'query': { 'query': {
'limit': None, 'limit': None,
'page': 1, 'page': 1,
'search': '',
} }
} }