fix(接口测试): 修复swagger导出失败问题

--bug=1021484 --user=郭雨琦
https://www.tapd.cn/55049933/bugtrace/bugs/view?bug_id=1155049933001021484&from=worktable_title
This commit is contained in:
guoyuqi 2023-01-03 10:56:31 +08:00 committed by 刘瑞斌
parent c5547e5228
commit c6f4030955
1 changed files with 6 additions and 3 deletions

View File

@ -1004,9 +1004,12 @@ public class Swagger3Parser extends SwaggerAbstractParser {
statusCodeInfo.put("content", buildContent(response));
statusCodeInfo.put("description", StringUtils.EMPTY);
JSONObject jsonObject = statusCode.getJSONObject(i);
jsonObject.get("name");
statusCodeInfo.put("description", jsonObject.get("value"));
responseBody.put(jsonObject.get("name").toString(), statusCodeInfo);
if (jsonObject.optString("value") != null) {
statusCodeInfo.put("description", jsonObject.optString("value"));
}
if (jsonObject.optString("name") != null) {
responseBody.put(jsonObject.optString("name"), statusCodeInfo);
}
}
return responseBody;
}