Cannot get API specs with Flask Blueprints and Swagger UI Cannot get API specs with Flask Blueprints and Swagger UI flask flask

Cannot get API specs with Flask Blueprints and Swagger UI


It looks like your just not hitting the right URL. Because your blueprint url_prefix is "/test", the Swagger spec url should be at:

localhost:5000/test/api/spec


I know this thread is old, but I ran into this exact problem today, trying to use flask-restful-swagger with my (somewhat) modern flask + python3 app that uses blueprints. Same problem, no errors, just no spec available no matter what i tried.

I finally abandoned this package (as it seems like it hasn't been very active anyway), even though I like the markup better with this package.

I chose Flasgger, which seemed to be updated more recently. In 10 minutes I had it up and running. Code and short tutorial are here: https://github.com/rochacbruno/flasgger


something wrong in swagger.docs()

from flask_restful import Apitest_blueprint = Blueprint('tests', __name__)test_api = swagger.docs(Api(test_blueprint)...)app.register_blueprint(test_blueprint)

what'more

main_blueprint = Blueprint('api', __name__, url_prefix='/demo')