From 72c300cc6cadb9e0f17d66fc0d514b073b0823f5 Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Wed, 17 Nov 2021 17:35:43 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E5=AE=8C=E5=96=84=E6=96=87=E6=A1=A3=E7=BB=93=E6=9E=84=E5=85=B3?= =?UTF-8?q?=E4=BA=8E=E6=95=B0=E7=BB=84=E7=B1=BB=E5=9E=8B=E7=9A=84=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../request/assertions/document/Document.java | 8 +++++++- .../assertion/document/DocumentBody.vue | 19 ++++++++++++++++--- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/backend/src/main/java/io/metersphere/api/dto/definition/request/assertions/document/Document.java b/backend/src/main/java/io/metersphere/api/dto/definition/request/assertions/document/Document.java index dd1205cfb7..71c9d05780 100644 --- a/backend/src/main/java/io/metersphere/api/dto/definition/request/assertions/document/Document.java +++ b/backend/src/main/java/io/metersphere/api/dto/definition/request/assertions/document/Document.java @@ -89,6 +89,9 @@ public class Document { list.add(newJSONPathAssertion(item, conditionMap.get(item.getId()))); } if (CollectionUtils.isNotEmpty(item.getChildren())) { + if (item.getType().equals("array") && !item.isArrayVerification()) { + continue; + } formatting(item.getChildren(), list, item, conditionMap); } } else { @@ -108,10 +111,13 @@ public class Document { } else { item.setJsonPath("$." + item.getName()); } - if (!StringUtils.equalsAny(item.getContentVerification(), "none", null) || item.isInclude()|| item.isArrayVerification() || item.isTypeVerification()) { + if (!StringUtils.equalsAny(item.getContentVerification(), "none", null) || item.isInclude() || item.isArrayVerification() || item.isTypeVerification()) { list.add(newXMLAssertion(item, conditionMap.get(item.getId()))); } if (CollectionUtils.isNotEmpty(item.getChildren())) { + if (item.getType().equals("array") && !item.isArrayVerification()) { + continue; + } xmlFormatting(item.getChildren(), list, item, conditionMap); } } diff --git a/frontend/src/business/components/api/definition/components/assertion/document/DocumentBody.vue b/frontend/src/business/components/api/definition/components/assertion/document/DocumentBody.vue index 45dfdf237b..14a6f9e3c5 100644 --- a/frontend/src/business/components/api/definition/components/assertion/document/DocumentBody.vue +++ b/frontend/src/business/components/api/definition/components/assertion/document/DocumentBody.vue @@ -16,12 +16,13 @@ @cell-mouse-enter="editRow" @cell-mouse-leave="editLeave" row-key="id" + border default-expand-all v-loading="loading"> @@ -69,7 +70,7 @@