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

--user=郭雨琦
This commit is contained in:
guoyuqi 2022-11-28 15:49:45 +08:00 committed by xiaomeinvG
parent 7f73938c5d
commit af36b9d063
1 changed files with 3 additions and 1 deletions

View File

@ -350,7 +350,9 @@ public class Swagger3Parser extends SwaggerAbstractParser {
JsonSchemaItem jsonSchemaItem = parseSchema(schema, refSet);
if (jsonSchemaItem == null) {
jsonSchemaItem = new JsonSchemaItem();
jsonSchemaItem.setType(schema.getType());
if (StringUtils.isNotBlank(schema.getType())) {
jsonSchemaItem.setType(schema.getType());
}
}
if (MapUtils.isEmpty(jsonSchemaItem.getProperties())) {
jsonSchemaItem.setProperties(new HashMap<>());