From 15c7c6ec7cb7ac78e7608aaba0a91bc44cce58cd Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Thu, 13 Apr 2023 10:02:31 +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=E5=AF=BC=E5=85=A5postman=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E4=B8=ADrest=E5=8F=82=E6=95=B0=E4=B8=BA=E7=A9=BA=E6=8A=A5?= =?UTF-8?q?=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 --- .../io/metersphere/api/parse/PostmanAbstractParserParser.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api-test/backend/src/main/java/io/metersphere/api/parse/PostmanAbstractParserParser.java b/api-test/backend/src/main/java/io/metersphere/api/parse/PostmanAbstractParserParser.java index 78ae5d834e..52f2ad4cf5 100644 --- a/api-test/backend/src/main/java/io/metersphere/api/parse/PostmanAbstractParserParser.java +++ b/api-test/backend/src/main/java/io/metersphere/api/parse/PostmanAbstractParserParser.java @@ -11,7 +11,6 @@ import io.metersphere.api.dto.scenario.KeyValue; import io.metersphere.api.parse.postman.*; import io.metersphere.commons.constants.MsRequestBodyType; import io.metersphere.commons.constants.PostmanRequestBodyMode; -import io.metersphere.commons.constants.RequestTypeConstants; import io.metersphere.commons.utils.BeanUtils; import io.metersphere.commons.utils.JSON; import io.metersphere.commons.utils.LogUtil; @@ -35,7 +34,8 @@ public abstract class PostmanAbstractParserParser extends ApiImportAbstractPa PostmanUrl url = requestDesc.getUrl(); MsHTTPSamplerProxy request = buildRequest(requestItem.getName(), url == null ? StringUtils.EMPTY : url.getRaw(), requestDesc.getMethod(), (requestDesc.getBody() == null || requestDesc.getBody().get("jsonSchema") == null) ? StringUtils.EMPTY : requestDesc.getBody().get("jsonSchema").textValue()); - request.setRest(parseKeyValue(requestDesc.getUrl().getVariable())); + request.setRest(parseKeyValue(url != null && CollectionUtils.isNotEmpty(url.getVariable()) ? + url.getVariable() : new ArrayList<>())); if (StringUtils.isNotBlank(request.getPath())) { String path = request.getPath().split("\\?")[0]; path = parseVariable(path);