fix(接口测试): 修复github#13793,无法使用引用的场景的“原场景环境”的缺陷

--bug=1013371 --user=王孝刚 【接口测试】github#13793,无法使用引用的场景的“原场景环境”
https://www.tapd.cn/55049933/s/1163341
This commit is contained in:
wxg0103 2022-05-24 18:50:22 +08:00 committed by f2c-ci-robot[bot]
parent cf2dcb8b8a
commit 7817bbe786
1 changed files with 7 additions and 3 deletions

View File

@ -708,9 +708,13 @@ public class ApiAutomationService {
} else if (value instanceof JSONArray) {
JSONArray valueArray = (JSONArray) value;
for (int i = 0; i < valueArray.size(); i++) {
JSONObject obj = (JSONObject) valueArray.get(i);
JSONObject targetValue = jsonMerge(obj, (JSONObject) target.getJSONArray(key).get(i));
target.getJSONArray(key).set(i, targetValue);
try {
JSONObject obj = (JSONObject) valueArray.get(i);
JSONObject targetValue = jsonMerge(obj, (JSONObject) target.getJSONArray(key).get(i));
target.getJSONArray(key).set(i, targetValue);
} catch (Exception e) {
LogUtil.error(e);
}
}
} else {
target.put(key, value);