I have several APIs, and all of them return JSON with a boolean field named success.
API 1
{"success": true, "data": "some data"}
API 2
{"success": false, "error": "error message"}
Can I write its swagger 2.0 document with something like a template, so I don't need to copy and paste the success field part in each API like this?
responses:
200:
schema:
properties:
success:
type: boolean
description: true if the request is successful.
data:
...
and
responses:
200:
schema:
properties:
success:
type: boolean
description: true if the request is successful.
error:
...
Thanks!