Skip to content

Commit

Permalink
Merge pull request #184 from mmichaels01/master
Browse files Browse the repository at this point in the history
Avoid inclusion of empty definition dict
  • Loading branch information
rochacbruno committed Mar 22, 2018
2 parents 49dc420 + 266f29d commit f85f3e4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion flasgger/marshmallow_apispec.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def convert_schemas(d, definitions=None):
definitions = {}
definitions.update(d.get('definitions', {}))

new = {'definitions': definitions}
new = {}
for k, v in d.items():
if isinstance(v, dict):
v = convert_schemas(v, definitions)
Expand All @@ -115,4 +115,7 @@ def convert_schemas(d, definitions=None):
else:
new[k] = v

if len(definitions.keys()) > 0:
new['definitions'] = definitions

return new

0 comments on commit f85f3e4

Please sign in to comment.