Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A way of adding all endpoint automatically. #23

Open
jwg4 opened this issue May 22, 2018 · 1 comment
Open

A way of adding all endpoint automatically. #23

jwg4 opened this issue May 22, 2018 · 1 comment
Assignees
Milestone

Comments

@jwg4
Copy link
Owner

jwg4 commented May 22, 2018

No description provided.

@jwg4 jwg4 self-assigned this May 22, 2018
@jwg4 jwg4 modified the milestones: 1.1, 1.2 May 22, 2018
@jwg4 jwg4 modified the milestones: 1.3, 1.4 Jul 15, 2019
@ValentinFrancois
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants