flask-autodoc icon indicating copy to clipboard operation
flask-autodoc copied to clipboard

does this extension support flask-restful

Open weiguang-zz opened this issue 7 years ago • 2 comments

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: image

thanks

zhangzheng

weiguang-zz avatar Oct 21 '16 12:10 weiguang-zz

+1

yingbo avatar Jul 14 '17 14:07 yingbo

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.

jwg4 avatar Jul 17 '17 09:07 jwg4