From 88c993e46f6d9ac7107c0a07116358bd65ae8afa Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Wed, 21 Feb 2024 15:31:25 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=8E=A5=E5=8F=A3=E6=96=87=E6=A1=A3=E6=89=93?= =?UTF-8?q?=E5=BC=80=E6=8A=A5=E9=94=99=E7=9A=84=E7=BC=BA=E9=99=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1034688 --user=王孝刚 【接口测试】github#28540,V2.10.11版本,接口文档打开报错 https://www.tapd.cn/55049933/s/1463237 --- .../main/java/io/metersphere/service/ShareInfoService.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api-test/backend/src/main/java/io/metersphere/service/ShareInfoService.java b/api-test/backend/src/main/java/io/metersphere/service/ShareInfoService.java index f9c04b1161..b82c5b2cb2 100644 --- a/api-test/backend/src/main/java/io/metersphere/service/ShareInfoService.java +++ b/api-test/backend/src/main/java/io/metersphere/service/ShareInfoService.java @@ -218,7 +218,7 @@ public class ShareInfoService extends BaseShareInfoService { if (apiModel.getRequest() != null) { ObjectNode requestObj = this.genJSONObject(apiModel.getRequest()); if (requestObj != null) { - if (requestObj.has("headers")) { + if (requestObj.has("headers") && requestObj.get("headers").isArray()) { List requestHeadDataArr = new LinkedList<>(); //head赋值 ArrayNode headArr = requestObj.withArray("headers"); @@ -232,7 +232,7 @@ public class ShareInfoService extends BaseShareInfoService { } //url参数赋值 ArrayNode urlParamArr = JSONUtil.createArray(); - if (requestObj.has("arguments")) { + if (requestObj.has("arguments") && requestObj.get("arguments").isArray()) { try { ArrayNode headArr = requestObj.withArray("arguments"); for (int index = 0; index < headArr.size(); index++) { @@ -247,7 +247,7 @@ public class ShareInfoService extends BaseShareInfoService { } //rest参数设置 ArrayNode restParamArr = JSONUtil.createArray(); - if (requestObj.has("rest")) { + if (requestObj.has("rest") && requestObj.get("rest").isArray()) { try { //urlParam -- rest赋值 ArrayNode headArr = requestObj.withArray("rest");