[英]Is there a way to introduce Swagger automated documentation into a solution that uses Flask Bluperints?
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.我想将 Swagger 文档介绍给我使用 Flask 和蓝图构建的项目,但我找不到这样做的方法。
eg例如
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?如何在坚持使用 Flask 和蓝图的同时引入
flasgger
或任何其他生成 Swagger UI 的框架?
I've tried using flask-openapi3, flassger and searching around but so far, I could not find the solution :(我已经尝试使用flask-openapi3、flassger 并四处搜索,但到目前为止,我找不到解决方案:(
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.