I'm reading the documentation for swagger documentation with flask-restx, and following the examples. I understand that in order to generate swagger docs for the parameters the API takes, I should do
@api.doc(params={'id': 'An ID'})
However, I can't find an explanation of how to document the API's response body. Not the response code, but the result returned by e.g. the get-method. What I'm looking for is something like the below:
class MyResource(Resource):
@api.doc(returns={"info": "Some very interesting information"})
def get(self, id):
res = some_function_of_id(id)
return {"info": res}
Anyone know if this is possible and if so, how?