acoomans / flask-autodoc

Flask autodoc automatically creates an online documentation for your flask application.
MIT License
98 stars 49 forks source link

does this extension support flask-restful #28

Open weiguang-zz opened 8 years ago

weiguang-zz commented 8 years ago

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

yingbo commented 7 years ago

+1

jwg4 commented 7 years ago

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.