From 89df13f5528fb638b4767081e951e93f81b52214 Mon Sep 17 00:00:00 2001 From: guoyuqi Date: Fri, 22 Jul 2022 17:37:28 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):?= =?UTF-8?q?=20=E8=A7=A3=E5=86=B3=E5=AF=BC=E5=85=A5=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E6=9C=89=E7=BC=BA=E5=A4=B1=E6=97=B6=E7=B3=BB=E7=BB=9F=E6=8A=A5?= =?UTF-8?q?=E9=94=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --user=郭雨琦 --bug=1015165 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001015165 --- .../metersphere/api/service/ApiDefinitionService.java | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 4937b17b47..a239c5695f 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java @@ -1090,6 +1090,16 @@ public class ApiDefinitionService { JsonNode exApiResponse = null; JsonNode apiResponse = null; + + if (StringUtils.isBlank(apiDefinition.getResponse()) && StringUtils.isBlank(existApi.getResponse())) { + return false; + } + if (StringUtils.isBlank(apiDefinition.getResponse()) && StringUtils.isNotBlank(existApi.getResponse())) { + return false; + } + if (StringUtils.isNotBlank(apiDefinition.getResponse()) && StringUtils.isBlank(existApi.getResponse())) { + return false; + } try { exApiResponse = objectMapper.readTree(existApi.getResponse()); apiResponse = objectMapper.readTree(apiDefinition.getResponse());