fix(接口测试): swagger导入报错

--user=郭雨琦
--bug=1016313
https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001016313
This commit is contained in:
guoyuqi 2022-08-25 14:42:42 +08:00 committed by f2c-ci-robot[bot]
parent 3f94f87cb0
commit 222826d43a
1 changed files with 6 additions and 2 deletions

View File

@ -536,8 +536,12 @@ public class Swagger3Parser extends SwaggerAbstractParser {
Map<String, JsonSchemaItem> JsonSchemaProperties = new LinkedHashMap<>(); Map<String, JsonSchemaItem> JsonSchemaProperties = new LinkedHashMap<>();
properties.forEach((key, value) -> { properties.forEach((key, value) -> {
JsonSchemaItem item = new JsonSchemaItem(); JsonSchemaItem item = new JsonSchemaItem();
if (StringUtils.isNotBlank(schema.getType())) {
item.setType(schema.getType()); item.setType(schema.getType());
}
if (StringUtils.isNotBlank(schema.getDescription())) {
item.setDescription(schema.getDescription()); item.setDescription(schema.getDescription());
}
JsonSchemaItem proItem = parseSchema(value, refSet); JsonSchemaItem proItem = parseSchema(value, refSet);
if (proItem != null) JsonSchemaProperties.put(key, proItem); if (proItem != null) JsonSchemaProperties.put(key, proItem);
}); });