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

--bug=1023848 --user=郭雨琦
https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001023848
This commit is contained in:
guoyuqi 2023-02-27 16:23:22 +08:00 committed by xiaomeinvG
parent a2c272aec0
commit 8b1be16833
1 changed files with 3 additions and 1 deletions

View File

@ -709,7 +709,9 @@ public class Swagger3Parser extends SwaggerAbstractParser {
paths.optJSONObject(apiDefinition.getPath()).put(apiDefinition.getMethod().toLowerCase(), methodDetail);
}
result.setPaths(JSONUtil.parseObjectNode(paths.toString()));
components.put("schemas", schemas.get(0));
if (CollectionUtils.isNotEmpty(schemas)) {
components.put("schemas", schemas.get(0));
}
result.setComponents(JSONUtil.parseObjectNode(components.toString()));
return result;
}