flask-restful-swagger icon indicating copy to clipboard operation
flask-restful-swagger copied to clipboard

Add support for documentation for standalone functions

Open ghsatpute opened this issue 7 years ago • 0 comments

I'm trying to generate document for following function

"Some code ommitted"
@swagger.operation(
        notes='some random note',
        responseClass=str,
        nickname='upload',
        parameters=[
          ],
        responseMessages=[
            {
              "code": 201,
              "message": "Created. The URL of the created blueprint should be in the Location header"
            }
          ]
        )
@app.route('/hello')
def get(self, todo_id):
	return "Hello World!"

api.add_resource(get, '/hello')

When I try to run this I get type object 'function' has no attribute 'methods'

Can we add support for standalone functions?

ghsatpute avatar May 05 '17 06:05 ghsatpute