fix(接口测试): 修复接口文档打开报错的缺陷
--bug=1034688 --user=王孝刚 【接口测试】github#28540,V2.10.11版本,接口文档打开报错 https://www.tapd.cn/55049933/s/1463237
This commit is contained in:
parent
6319ac3249
commit
88c993e46f
|
@ -218,7 +218,7 @@ public class ShareInfoService extends BaseShareInfoService {
|
||||||
if (apiModel.getRequest() != null) {
|
if (apiModel.getRequest() != null) {
|
||||||
ObjectNode requestObj = this.genJSONObject(apiModel.getRequest());
|
ObjectNode requestObj = this.genJSONObject(apiModel.getRequest());
|
||||||
if (requestObj != null) {
|
if (requestObj != null) {
|
||||||
if (requestObj.has("headers")) {
|
if (requestObj.has("headers") && requestObj.get("headers").isArray()) {
|
||||||
List<JsonNode> requestHeadDataArr = new LinkedList<>();
|
List<JsonNode> requestHeadDataArr = new LinkedList<>();
|
||||||
//head赋值
|
//head赋值
|
||||||
ArrayNode headArr = requestObj.withArray("headers");
|
ArrayNode headArr = requestObj.withArray("headers");
|
||||||
|
@ -232,7 +232,7 @@ public class ShareInfoService extends BaseShareInfoService {
|
||||||
}
|
}
|
||||||
//url参数赋值
|
//url参数赋值
|
||||||
ArrayNode urlParamArr = JSONUtil.createArray();
|
ArrayNode urlParamArr = JSONUtil.createArray();
|
||||||
if (requestObj.has("arguments")) {
|
if (requestObj.has("arguments") && requestObj.get("arguments").isArray()) {
|
||||||
try {
|
try {
|
||||||
ArrayNode headArr = requestObj.withArray("arguments");
|
ArrayNode headArr = requestObj.withArray("arguments");
|
||||||
for (int index = 0; index < headArr.size(); index++) {
|
for (int index = 0; index < headArr.size(); index++) {
|
||||||
|
@ -247,7 +247,7 @@ public class ShareInfoService extends BaseShareInfoService {
|
||||||
}
|
}
|
||||||
//rest参数设置
|
//rest参数设置
|
||||||
ArrayNode restParamArr = JSONUtil.createArray();
|
ArrayNode restParamArr = JSONUtil.createArray();
|
||||||
if (requestObj.has("rest")) {
|
if (requestObj.has("rest") && requestObj.get("rest").isArray()) {
|
||||||
try {
|
try {
|
||||||
//urlParam -- rest赋值
|
//urlParam -- rest赋值
|
||||||
ArrayNode headArr = requestObj.withArray("rest");
|
ArrayNode headArr = requestObj.withArray("rest");
|
||||||
|
|
Loading…
Reference in New Issue