acoomans / flask-autodoc

Flask autodoc automatically creates an online documentation for your flask application.
MIT License
98 stars 49 forks source link

The list of arguments is incorrect #5

Closed olivierdeckers closed 10 years ago

olivierdeckers commented 10 years ago

The list of arguments is obtained using func.func_code.co_varnames in autodoc.py:101

This results in a list that contains more names than the function has arguments. I think you should use the inspect module to abstract away implementation issues, see http://stackoverflow.com/questions/10120974/where-is-the-default-parameter-in-python-function

ehamiter commented 10 years ago

I tried out using inspect per the link above, but the problem there is that it skips over any methods that have extra decorators on it (like permissions, etc.). I found a solution for my needs-- I changed it to rule.arguments and it works as expected.

acoomans commented 10 years ago

I'm merging @ehamiter's fix. I hope this fixes your issue.