我正在使用swashbuckle记录我的 web api 项目,我无法为前置条件失败的情况添加多个响应,swagger 只显示最后一个。
/// <response code="200">OK</response>
/// <response code="401">Unauthorized</response>
/// <response code="400">BadRequest</response>
/// <response code="412">ErrorCode = 1... </response>
/// <response code="412">ErrorCode = 2... </response>
/// <response code="412">ErrorCode = 3... </response>
Swashbuckle 生成如下内容:
{
...
"responses": {
"200": {
"description": "OK"
},
"400": {
"description": "BadRequest"
},
"401": {
"description": "Unauthorized"
},
"412": {
"description": "ErrorCode = 3..."
}
}
...
}
我想看的地方:
{
...
"412": {
"description": "ErrorCode = 1..."
},
"412": {
"description": "ErrorCode = 2..."
},
"412": {
"description": "ErrorCode = 3..."
}
}
有什么想法吗?
提前致谢