flask-autodoc
flask-autodoc copied to clipboard
does this extension support flask-restful
I want to check that if this extensions support flask-restful, here is my test code:
from flask_autodoc.autodoc import Autodoc
from flask_restful import Resource,Api
class Post(Resource):
@auto.doc()
def get(self):
return 'post'
class Doc(Resource):
def get(self):
return auto.html()
api = Api(app)
api.add_resource(Post,'/post')
api.add_resource(Doc,'/doc')
however, the results shows that it does not support the flask-restful api:
thanks
zhangzheng
+1
I don't see how this could work. The function Post.get()
doesn't by design have any metadata about how it will appear as a HTTP endpoint.
There is simple code which allows you to go through all endpoints which have been added to a Flask app and add documentation for each one. You could use this.