fix(接口测试): 修复接口文档打开报错的缺陷

--bug=1034688 --user=王孝刚 【接口测试】github#28540,V2.10.11版本,接口文档打开报错 https://www.tapd.cn/55049933/s/1463237
This commit is contained in:
wxg0103 2024-02-21 15:31:25 +08:00 committed by Craftsman
parent 6319ac3249
commit 88c993e46f
1 changed files with 3 additions and 3 deletions

View File

@ -218,7 +218,7 @@ public class ShareInfoService extends BaseShareInfoService {
if (apiModel.getRequest() != null) {
ObjectNode requestObj = this.genJSONObject(apiModel.getRequest());
if (requestObj != null) {
if (requestObj.has("headers")) {
if (requestObj.has("headers") && requestObj.get("headers").isArray()) {
List<JsonNode> requestHeadDataArr = new LinkedList<>();
//head赋值
ArrayNode headArr = requestObj.withArray("headers");
@ -232,7 +232,7 @@ public class ShareInfoService extends BaseShareInfoService {
}
//url参数赋值
ArrayNode urlParamArr = JSONUtil.createArray();
if (requestObj.has("arguments")) {
if (requestObj.has("arguments") && requestObj.get("arguments").isArray()) {
try {
ArrayNode headArr = requestObj.withArray("arguments");
for (int index = 0; index < headArr.size(); index++) {
@ -247,7 +247,7 @@ public class ShareInfoService extends BaseShareInfoService {
}
//rest参数设置
ArrayNode restParamArr = JSONUtil.createArray();
if (requestObj.has("rest")) {
if (requestObj.has("rest") && requestObj.get("rest").isArray()) {
try {
//urlParam -- rest赋值
ArrayNode headArr = requestObj.withArray("rest");