[BUG][Python-Flask] Primitive type bytearray deserialization missing in util.py. #2724 (#3642)

* added bytearray to list of types

* adding regenerated sample files for python-flask
This commit is contained in:
Shogoki 2019-08-22 11:15:10 +02:00 committed by William Cheng
parent 8741a8ca35
commit a748e1ff9a
6 changed files with 5 additions and 17 deletions

View File

@ -16,7 +16,7 @@ def _deserialize(data, klass):
if data is None: if data is None:
return None return None
if klass in six.integer_types or klass in (float, str, bool): if klass in six.integer_types or klass in (float, str, bool, bytearray):
return _deserialize_primitive(data, klass) return _deserialize_primitive(data, klass)
elif klass == object: elif klass == object:
return _deserialize_object(data) return _deserialize_object(data)

View File

@ -49,15 +49,13 @@ def find_pets_by_status(status): # noqa: E501
return 'do some magic!' return 'do some magic!'
def find_pets_by_tags(tags, max_count=None): # noqa: E501 def find_pets_by_tags(tags): # noqa: E501
"""Finds Pets by tags """Finds Pets by tags
Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. # noqa: E501 Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. # noqa: E501
:param tags: Tags to filter by :param tags: Tags to filter by
:type tags: List[str] :type tags: List[str]
:param max_count: Maximum number of items to return
:type max_count: int
:rtype: List[Pet] :rtype: List[Pet]
""" """

View File

@ -115,15 +115,6 @@ paths:
type: string type: string
type: array type: array
style: form style: form
- description: Maximum number of items to return
explode: true
in: query
name: maxCount
required: false
schema:
format: int32
type: integer
style: form
responses: responses:
200: 200:
content: content:

View File

@ -89,8 +89,7 @@ class TestPetController(BaseTestCase):
Finds Pets by tags Finds Pets by tags
""" """
query_string = [('tags', 'tags_example'), query_string = [('tags', 'tags_example')]
('maxCount', 56)]
headers = { headers = {
'Accept': 'application/json', 'Accept': 'application/json',
'Authorization': 'Bearer special-key', 'Authorization': 'Bearer special-key',

View File

@ -16,7 +16,7 @@ def _deserialize(data, klass):
if data is None: if data is None:
return None return None
if klass in six.integer_types or klass in (float, str, bool): if klass in six.integer_types or klass in (float, str, bool, bytearray):
return _deserialize_primitive(data, klass) return _deserialize_primitive(data, klass)
elif klass == object: elif klass == object:
return _deserialize_object(data) return _deserialize_object(data)

View File

@ -16,7 +16,7 @@ def _deserialize(data, klass):
if data is None: if data is None:
return None return None
if klass in six.integer_types or klass in (float, str, bool): if klass in six.integer_types or klass in (float, str, bool, bytearray):
return _deserialize_primitive(data, klass) return _deserialize_primitive(data, klass)
elif klass == object: elif klass == object:
return _deserialize_object(data) return _deserialize_object(data)