flask-selfdoc
flask-selfdoc copied to clipboard
A way of adding all endpoint automatically.
A working solution for me was:
from flask_selfdoc import Autodoc
from my_app import app
auto = Autodoc(app)
for rule in app.url_map.iter_rules():
auto.doc()(app.view_functions[rule.endpoint])
I think it's not too hacky and could maybe be temporarily part of the documentation until there's a better way to do it. Especially because the doc says:
by default, Flask-Selfdoc will only document the routes explicitly decorated with doc
but doesn't explain what to do if we want to override this default behaviour.