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

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

View File

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