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 3b682bf9ac..74b5c98d26 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 @@ -586,6 +586,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 6e1bab6fa3..b306147957 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java @@ -874,7 +874,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 {