Skip to content
This repository has been archived by the owner on Aug 29, 2024. It is now read-only.

Commit

Permalink
fix issue where array items is a list of types
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Therieau committed Mar 24, 2017
1 parent 3c0d880 commit 1569e29
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion swagger_parser/swagger_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,11 @@ def _example_from_array_spec(self, prop_spec):
Returns:
An example array.
"""
# if items is a list, then each item has its own spec
if isinstance(prop_spec['items'], list):
return [self.get_example_from_prop_spec(item_prop_spec) for item_prop_spec in prop_spec['items']]
# Standard types in array
if 'type' in prop_spec['items'].keys():
elif 'type' in prop_spec['items'].keys():
if 'format' in prop_spec['items'].keys() and prop_spec['items']['format'] == 'date-time':
return self._get_example_from_basic_type('datetime')
else:
Expand Down

0 comments on commit 1569e29

Please sign in to comment.