From 29db1e54abe5a732f2285b3c80d5d95cc28c8f2c 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 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 {