fix(接口测试): 修复接口导入未导入query值的缺陷
--bug=1039645 --user=王孝刚 【接口测试】接口定义-导入swagger文件中query参数值未导入 https://www.tapd.cn/55049933/s/1500400
This commit is contained in:
parent
d41583c4cd
commit
e895f6ee8b
|
@ -434,6 +434,9 @@ public class Swagger3Parser<T> implements ImportParser<ApiDefinitionImport> {
|
|||
queryParam.setMinLength(queryParameter.getSchema().getMinLength());
|
||||
queryParam.setMaxLength(queryParameter.getSchema().getMaxLength());
|
||||
}
|
||||
if (queryParameter.getExample() != null) {
|
||||
queryParam.setValue(getDefaultObjectValue(queryParameter.getExample()));
|
||||
}
|
||||
arguments.add(queryParam);
|
||||
}
|
||||
|
||||
|
@ -445,6 +448,9 @@ public class Swagger3Parser<T> implements ImportParser<ApiDefinitionImport> {
|
|||
if (cookieParameter.getSchema() != null) {
|
||||
headerParams.setValue(getDefaultObjectValue(cookieParameter.getSchema().getExample()));
|
||||
}
|
||||
if (cookieParameter.getExample() != null) {
|
||||
headerParams.setValue(getDefaultObjectValue(cookieParameter.getExample()));
|
||||
}
|
||||
headers.add(headerParams);
|
||||
}
|
||||
|
||||
|
@ -455,6 +461,9 @@ public class Swagger3Parser<T> implements ImportParser<ApiDefinitionImport> {
|
|||
if (headerParameter.getSchema() != null) {
|
||||
headerParams.setValue(getDefaultObjectValue(headerParameter.getSchema().getExample()));
|
||||
}
|
||||
if (headerParameter.getExample() != null) {
|
||||
headerParams.setValue(getDefaultObjectValue(headerParameter.getExample()));
|
||||
}
|
||||
headers.add(headerParams);
|
||||
}
|
||||
|
||||
|
@ -470,6 +479,9 @@ public class Swagger3Parser<T> implements ImportParser<ApiDefinitionImport> {
|
|||
restParam.setMinLength(parameter.getSchema().getMinLength());
|
||||
restParam.setMaxLength(parameter.getSchema().getMaxLength());
|
||||
}
|
||||
if (parameter.getExample() != null) {
|
||||
restParam.setValue(getDefaultObjectValue(parameter.getExample()));
|
||||
}
|
||||
rest.add(restParam);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue