From f29e9841ee3726ea91f72b5e9ab28e6d967715c1 Mon Sep 17 00:00:00 2001 From: guoyuqi Date: Wed, 13 Jul 2022 13:35:58 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E8=A7=A3=E5=86=B3=E8=A6=86=E7=9B=96=E5=AF=BC=E5=85=A5=E6=8A=A5?= =?UTF-8?q?=E9=94=99=E4=BB=A5=E5=8F=8Aswagger=E5=AF=BC=E5=87=BAtag?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --user=郭雨琦 --bug=1014812 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001014812 --bug=1014699 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001014699 --- .../metersphere/api/dto/definition/parse/Swagger3Parser.java | 3 +++ .../java/io/metersphere/api/service/ApiDefinitionService.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) 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 {