fix(接口测试): 修复接口导入postman文件没有body报错问题

https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001019477
--user=郭雨琦
This commit is contained in:
guoyuqi 2022-11-07 18:23:20 +08:00 committed by xiaomeinvG
parent 057a8a08cc
commit 4dc898b8d5
1 changed files with 1 additions and 1 deletions

View File

@ -34,7 +34,7 @@ public abstract class PostmanAbstractParserParser<T> extends ApiImportAbstractPa
requestDesc.getAuth(); // todo 认证方式等待优化 requestDesc.getAuth(); // todo 认证方式等待优化
PostmanUrl url = requestDesc.getUrl(); PostmanUrl url = requestDesc.getUrl();
MsHTTPSamplerProxy request = buildRequest(requestItem.getName(), url == null ? StringUtils.EMPTY : url.getRaw(), requestDesc.getMethod(), MsHTTPSamplerProxy request = buildRequest(requestItem.getName(), url == null ? StringUtils.EMPTY : url.getRaw(), requestDesc.getMethod(),
requestDesc.getBody().get("jsonSchema") == null ? StringUtils.EMPTY : requestDesc.getBody().get("jsonSchema").textValue()); (requestDesc.getBody()==null||requestDesc.getBody().get("jsonSchema") == null)? StringUtils.EMPTY : requestDesc.getBody().get("jsonSchema").textValue());
request.setRest(parseKeyValue(requestDesc.getUrl().getVariable())); request.setRest(parseKeyValue(requestDesc.getUrl().getVariable()));
if (StringUtils.isNotBlank(request.getPath())) { if (StringUtils.isNotBlank(request.getPath())) {
String path = request.getPath().split("\\?")[0]; String path = request.getPath().split("\\?")[0];