fix(接口定义): 倒入Swagger提示解析出错

--bug=1009120 --user=郭雨琦 【ID1009120】【接口定义】倒入Swagger提示解析出错
This commit is contained in:
guoyuqi 2021-12-22 18:39:46 +08:00 committed by xiaomeinvG
parent 4c0b392c1b
commit 1796b3473a
1 changed files with 4 additions and 4 deletions

View File

@ -246,8 +246,8 @@ public class Swagger3Parser extends SwaggerAbstractParser {
msResponse.setType(RequestType.HTTP);
// todo 状态码要调整
msResponse.setStatusCode(new ArrayList<>());
ApiResponse apiResponse = responses.get("200");
if (responses != null) {
ApiResponse apiResponse = responses.get("200");
if (apiResponse == null) {
responses.forEach((responseCode, response) -> {
parseResponseHeader(response, msResponse.getHeaders());
@ -257,10 +257,10 @@ public class Swagger3Parser extends SwaggerAbstractParser {
parseResponseHeader(apiResponse, msResponse.getHeaders());
parseResponseBody(apiResponse, msResponse.getBody());
}
}
responses.forEach((responseCode, response) -> {
parseResponseCode(msResponse.getStatusCode(), responseCode, response);
});
}
return msResponse;
}