Discussion migrated from this commit comment.
As mentioned on this swagger-spec issue, this is required to be compliant with the spec but simply not quite clearly worded.
I don't think we should put this behind an option as we would essentially be allowing users to create noncompliant output, which can break outside tooling.
It seems to me that GoDaddy doesn't need multiple response types, so much as they need one response type and multiple error types. Would it not make sense to do something more like the following:
{
"path": "/user/walletHistory",
"operations": [{
"method": "GET",
"nickname": "getWalletHistory",
"parameters": [],
"responseMessages": [{
"code": 200,
"message": "Request was successful"
}, {
"code": 401,
"message": "Unauthorized",
"responseModel": "error"
}, {
"code": 404,
"message": "Not Found",
"responseModel": "error"
}],
"type": "array",
"items": {
"type": "transaction"
}
}]
}
This produces something like this, which eliminates the redundancy by excluding the responseModel from the 200.

Discussion migrated from this commit comment.
As mentioned on this swagger-spec issue, this is required to be compliant with the spec but simply not quite clearly worded.
I don't think we should put this behind an option as we would essentially be allowing users to create noncompliant output, which can break outside tooling.
It seems to me that GoDaddy doesn't need multiple response types, so much as they need one response type and multiple error types. Would it not make sense to do something more like the following:
{ "path": "/user/walletHistory", "operations": [{ "method": "GET", "nickname": "getWalletHistory", "parameters": [], "responseMessages": [{ "code": 200, "message": "Request was successful" }, { "code": 401, "message": "Unauthorized", "responseModel": "error" }, { "code": 404, "message": "Not Found", "responseModel": "error" }], "type": "array", "items": { "type": "transaction" } }] }This produces something like this, which eliminates the redundancy by excluding the
responseModelfrom the 200.