pyeve / eve-swagger

Swagger extension for Eve-powered RESTful APIs
http://python-eve.org
Other
154 stars 43 forks source link

eve-swagger crashes if no docstring for hook is found #36

Closed hermannsblum closed 7 years ago

hermannsblum commented 7 years ago

If there is no docstring provided for a hook function, eve swagger will crash because of this line

s += '\n    '.join(dedent(cb.__doc__).strip().split('\n'))

where dedent cannot handle cb.doc = None

In addition to the fix, I propose here to still document that the hook exists and simply add 'no documentation' as an indicator that there is no further documentation for the function found.

nicolaiarocci commented 7 years ago

Thanks!