fix(接口测试): github#13037Swagger2.0的脚本导入到MS后,响应内容状态码显示错误

--bug=1012802
--user=郭雨琦
https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001012802
This commit is contained in:
guoyuqi 2022-04-27 12:35:36 +08:00 committed by 刘瑞斌
parent 29a6d9bcc6
commit d049431f26
1 changed files with 5 additions and 1 deletions

View File

@ -265,7 +265,11 @@ public class Swagger2Parser extends SwaggerAbstractParser {
msResponse.setStatusCode(new ArrayList<>());
if (responses != null && responses.size() > 0) {
responses.forEach((responseCode, response) -> {
msResponse.getStatusCode().add(new KeyValue(responseCode, responseCode));
if(StringUtils.isNotBlank(response.getDescription())){
msResponse.getStatusCode().add(new KeyValue(responseCode, response.getDescription()));
}else{
msResponse.getStatusCode().add(new KeyValue(responseCode, responseCode));
}
if (responseCode.equals("200")&&response.getResponseSchema()!=null) {
parseResponseBody(response.getResponseSchema(),msResponse.getBody());
msResponse.getBody().setFormat("JSON-SCHEMA");