fix: 修复 【github#8151】使用 postman 或者 idea 插件导入时,pathvariable 无法自带显示到 rest参数中

This commit is contained in:
zhangdahai112 2021-12-06 13:37:09 +08:00 committed by 刘瑞斌
parent cfb0999bb9
commit 8eb763de03
2 changed files with 2 additions and 0 deletions

View File

@ -11,4 +11,5 @@ public class PostmanUrl {
private String protocol; private String protocol;
private String port; private String port;
private List<PostmanKeyValue> query; private List<PostmanKeyValue> query;
private List<PostmanKeyValue> variable;
} }

View File

@ -31,6 +31,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 ? "" : url.getRaw(), requestDesc.getMethod()); MsHTTPSamplerProxy request = buildRequest(requestItem.getName(), url == null ? "" : url.getRaw(), requestDesc.getMethod());
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];
path = parseVariable(path); path = parseVariable(path);