diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/Swagger3Parser.java b/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/Swagger3Parser.java index 12e455c55a..05202f7e29 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/Swagger3Parser.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/parser/api/Swagger3Parser.java @@ -144,7 +144,7 @@ public class Swagger3Parser extends ApiImportAbstractParser { - setBodyData(key, value, body); + setResponseBodyData(key, value, body); }); } else { body.setBodyType(Body.BodyType.NONE.name()); @@ -186,7 +186,7 @@ public class Swagger3Parser extends ApiImportAbstractParser { HttpResponse httpResponse = new HttpResponse(); //TODO headers - httpResponse.setStatusCode(StringUtils.equals("default", key) ? "200" :key); + httpResponse.setStatusCode(StringUtils.equals("default", key) ? "200" : key); ResponseBody body = new ResponseBody(); Map headers = value.getHeaders(); if (MapUtils.isNotEmpty(headers)) { @@ -202,7 +202,7 @@ public class Swagger3Parser extends ApiImportAbstractParser { - setBodyData(k, v, body); + setResponseBodyData(k, v, body); }); } else { body.setBodyType(Body.BodyType.NONE.name()); @@ -214,7 +214,7 @@ public class Swagger3Parser extends ApiImportAbstractParser extends ApiImportAbstractParser extends ApiImportAbstractParser items) { - return isRef(items, level + 1); + if (schema instanceof IntegerSchema) { + return false; + } + if (schema instanceof StringSchema) { + return false; + } + if (schema instanceof NumberSchema) { + return false; + } + if (schema instanceof BooleanSchema) { + return false; } return false; @@ -619,13 +627,13 @@ public class Swagger3Parser extends ApiImportAbstractParser properties = objectSchema.getProperties(); if (MapUtils.isNotEmpty(properties)) { for (Schema value : properties.values()) { - if (value instanceof ArraySchema && isRef(((ArraySchema) value).getItems(), level + 1)) { + if (value instanceof ArraySchema && isRef(((ArraySchema) value).getItems(), level + 1) && level > 20) { return true; } - if (value instanceof ObjectSchema && isRef(value, level + 1)) { + if (value instanceof ObjectSchema && isRef(value, level + 1) && level > 20) { return true; } - if (value instanceof Schema items && isRef(items, level + 1)) { + if (value instanceof Schema items && isRef(items, level + 1) && level > 20) { return true; } } diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/service/definition/ApiDefinitionService.java b/backend/services/api-test/src/main/java/io/metersphere/api/service/definition/ApiDefinitionService.java index da7e4d86cd..27edebcfc9 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/service/definition/ApiDefinitionService.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/service/definition/ApiDefinitionService.java @@ -2,7 +2,6 @@ package io.metersphere.api.service.definition; import io.metersphere.api.constants.ApiConstants; import io.metersphere.api.constants.ApiDefinitionDocType; -import io.metersphere.sdk.constants.ApiFileResourceType; import io.metersphere.api.constants.ApiResourceType; import io.metersphere.api.controller.result.ApiResultCode; import io.metersphere.api.domain.*; @@ -26,7 +25,7 @@ import io.metersphere.project.mapper.ExtBaseProjectVersionMapper; import io.metersphere.project.service.EnvironmentService; import io.metersphere.project.service.MoveNodeService; import io.metersphere.project.service.ProjectService; -import io.metersphere.sdk.constants.ApiReportStatus; +import io.metersphere.sdk.constants.ApiFileResourceType; import io.metersphere.sdk.constants.ApplicationNumScope; import io.metersphere.sdk.constants.DefaultRepositoryDir; import io.metersphere.sdk.constants.ModuleConstants; @@ -441,13 +440,13 @@ public class ApiDefinitionService extends MoveNodeService { private void processApiDefinitions(List list, String projectId) { Set userIds = extractUserIds(list); Map userMap = userLoginService.getUserNameMap(new ArrayList<>(userIds)); - List apiDefinitionIds = list.stream().map(ApiDefinitionDTO::getId).toList(); + /* List apiDefinitionIds = list.stream().map(ApiDefinitionDTO::getId).toList(); List apiCaseComputeList = extApiDefinitionMapper.selectApiCaseByIdsAndStatusIsNotTrash(apiDefinitionIds, projectId); Map resultMap = apiCaseComputeList.stream().collect(Collectors.toMap(ApiCaseComputeDTO::getApiDefinitionId, Function.identity())); List customFields = extApiDefinitionCustomFieldMapper.getApiCustomFields(apiDefinitionIds, projectId); Map> customFieldMap = customFields.stream().collect(Collectors.groupingBy(ApiDefinitionCustomFieldDTO::getApiId)); - +*/ list.forEach(item -> { // Convert User IDs to Names item.setCreateUserName(userMap.get(item.getCreateUser())); @@ -455,7 +454,7 @@ public class ApiDefinitionService extends MoveNodeService { item.setUpdateUserName(userMap.get(item.getUpdateUser())); // Custom Fields - item.setCustomFields(customFieldMap.get(item.getId())); + /*item.setCustomFields(customFieldMap.get(item.getId())); // Calculate API Case Metrics ApiCaseComputeDTO apiCaseComputeDTO = resultMap.get(item.getId()); @@ -476,7 +475,7 @@ public class ApiDefinitionService extends MoveNodeService { item.setCaseTotal(0); item.setCasePassRate("-"); item.setCaseStatus("-"); - } + }*/ }); } diff --git a/backend/services/bug-management/src/main/java/io/metersphere/bug/dto/request/BugEditRequest.java b/backend/services/bug-management/src/main/java/io/metersphere/bug/dto/request/BugEditRequest.java index 7df07818f2..98032acdd3 100644 --- a/backend/services/bug-management/src/main/java/io/metersphere/bug/dto/request/BugEditRequest.java +++ b/backend/services/bug-management/src/main/java/io/metersphere/bug/dto/request/BugEditRequest.java @@ -58,10 +58,10 @@ public class BugEditRequest implements Serializable { @Schema(description = "用例ID") private String caseId; - @Schema(description = "测试计划ID") + @Schema(description = "测试计划ID,通过测试计划创建的必填") private String testPlanId; - @Schema(description = "测试计划管理的用例ID") + @Schema(description = "测试计划关联的用例ID, 通过测试计划创建的必填,值是关联的id而不是用例id") private String testPlanCaseId; @Schema(description = "复制的附件")