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 c7f02a875e..bbf8a755e8 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 @@ -595,6 +595,9 @@ public class Swagger3Parser extends SwaggerAbstractParser { if (modulePath.contains("/")) { split = modulePath.split("/"); } + if (split.length == 0 && StringUtils.isNotBlank(modulePath)) { + split = new String[]{modulePath}; + } swaggerApiInfo.setTags(Arrays.asList(split)); } 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 9294f56108..2d28fa4de5 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java @@ -897,7 +897,7 @@ public class ApiDefinitionService { apiDefinition.setCreateTime(System.currentTimeMillis()); apiDefinition.setUpdateTime(System.currentTimeMillis()); - if (apiDefinition.getVersionId().equals("update")) { + if (apiDefinition.getVersionId() != null && apiDefinition.getVersionId().equals("update")) { if (StringUtils.isNotEmpty(apiTestImportRequest.getUpdateVersionId())) { apiDefinition.setVersionId(apiTestImportRequest.getUpdateVersionId()); } else {