Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions sphinxcontrib/openapi/openapi20.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,14 @@ def _convert(schema, name='', required=False):
(prop in required_properties))

elif type_ == 'array':
_convert(schema['items'], name + '[]')
name = name.lstrip('.')
description = schema.get('description', '')
output.append((
name,
'{type_} {name}:'
' {description}'.format(**locals())))
if schema['items'].get('type', 'any') not in ['string', 'number', 'integer', 'boolean']:
_convert(schema['items'], name + '[]')

else:
if name:
Expand Down Expand Up @@ -227,7 +234,7 @@ def openapihttpdomain(spec, **options):
if 'group' in options:
groups = collections.OrderedDict(
[(x['name'], []) for x in spec.get('tags', {})]
)
)

for endpoint in paths:
for method, properties in spec['paths'][endpoint].items():
Expand All @@ -239,7 +246,7 @@ def openapihttpdomain(spec, **options):
method,
properties,
utils.get_text_converter(options),
))
))

for key in groups.keys():
if key:
Expand All @@ -258,6 +265,6 @@ def openapihttpdomain(spec, **options):
method,
properties,
utils.get_text_converter(options),
))
))

return iter(itertools.chain(*generators))