Does Flask RESTPlus support the Open API response examples property?

Viewed 290

Given a Flask RESTPlus model like:

todo = api.model("Todo", {
    "id": fields.Integer(example=123),
    "task": fields.String(example="Feed the cat")
})

I want Flask RESTPlus support the Open API response examples property, to export a spec like:

paths:
  /todos/{id}
    get:
      responses:
        '200':
          description: OK
          schema:
            $ref: '#/definitions/Todo'
          examples:
            application/json:
              id: 123
              task: Feed the cat

I have explored the api.doc() & api.response() decorators, but they don't seem to support the response property. E.g.:

    @api.response(200, "OK", todo)
    @api.marshal_with(todo)
    def get(self):
        # . . . 

. . . doesn't populate the response examples property.

Version: flask-restplus==0.13.0

0 Answers
Related