diff --git a/backend/src/main/java/io/metersphere/api/dto/definition/parse/Swagger3Parser.java b/backend/src/main/java/io/metersphere/api/dto/definition/parse/Swagger3Parser.java index 4e2a8ec128..acfe61b99f 100644 --- a/backend/src/main/java/io/metersphere/api/dto/definition/parse/Swagger3Parser.java +++ b/backend/src/main/java/io/metersphere/api/dto/definition/parse/Swagger3Parser.java @@ -381,7 +381,12 @@ public class Swagger3Parser extends SwaggerAbstractParser { Object propertiesResult = parseSchemaPropertiesToJson(schema, refSet, infoMap); return propertiesResult == null ? getDefaultValueByPropertyType(schema) : propertiesResult; } else { - return getDefaultValueByPropertyType(schema); + if (MapUtils.isNotEmpty(schema.getProperties())) { + Object propertiesResult = parseSchemaPropertiesToJson(schema, refSet, infoMap); + return propertiesResult == null ? getDefaultValueByPropertyType(schema) : propertiesResult; + } else { + return getDefaultValueByPropertyType(schema); + } } } diff --git a/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java b/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java index b644c82d29..0b56483a56 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java @@ -2155,7 +2155,7 @@ public class ApiDefinitionService { if (!resList.isEmpty()) { List ids = resList.stream().map(ApiDefinitionResult::getId).collect(Collectors.toList()); List results = new ArrayList<>(); - if (request != null && request.getFilters().containsKey("status") && request.getFilters().get("status").get(0).equals("Trash")) { + if (request != null && MapUtils.isNotEmpty(request.getFilters()) && request.getFilters().containsKey("status") && request.getFilters().get("status").get(0).equals("Trash")) { results = extApiDefinitionMapper.selectByIdsAndStatusIsTrash(ids, projectId); } else { results = extApiDefinitionMapper.selectByIdsAndStatusIsNotTrash(ids, projectId); diff --git a/backend/src/main/java/io/metersphere/api/service/ApiModuleService.java b/backend/src/main/java/io/metersphere/api/service/ApiModuleService.java index 979ea9c213..a1a20c06f0 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiModuleService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiModuleService.java @@ -702,7 +702,7 @@ public class ApiModuleService extends NodeTreeService { if (CollectionUtils.isNotEmpty(repeatApiDefinitionWithBLOBs)) { oldCaseMap = getOldCaseMap(repeatApiDefinitionWithBLOBs); } - Map repeatDataMap = null; + Map repeatDataMap = new HashMap<>(); Map optionMap = new HashMap<>(); if (chooseModule != null) {