Reputation: 21
I would like to introduce Swagger documentation to a project I built using Flask and Blueprints, but I couldn't find a way to do so.
e.g.
from flask import Flask, Blueprint
class HealthController():
def __init__(self):
self.blueprint = self.define_routes()
def define_routes(self):
blueprint = Blueprint('health', __name__)
@blueprint.route('/api/health', methods=['GET'])
def health():
return flask.jsonify({"result": True}), 200
return blueprint
application = Flask(__name__)
application.register_blueprint(HealthController().blueprint)
application.run()
How do I introduce a flasgger
or any other framework generating Swagger UI while sticking to Flask and Blueprints?
I've tried using flask-openapi3, flassger and searching around but so far, I could not find the solution :(
Upvotes: 1
Views: 1150