Fixed override problem when expecting merge #117

This commit is contained in:
Francis Dong
2021-04-12 11:15:49 +08:00
committed by dxfeng10
parent 64cd82ed5d
commit 6a11c8b701
3 changed files with 147 additions and 2 deletions

View File

@@ -29,6 +29,7 @@ import org.noear.snack.ONode;
import we.constants.CommonConstants;
import we.fizz.StepContext;
import we.util.MapUtil;
/**
*
@@ -380,12 +381,12 @@ public class PathMapping {
Map<String, Object> scriptRules = PathMapping.getScriptRules(mappingRules);
Map<String, Object> scriptResult = ScriptHelper.executeScripts(target, scriptRules, ctxNode, stepContext, supportMultiLevels);
if (scriptResult != null && !scriptResult.isEmpty()) {
result.putAll(scriptResult);
result = MapUtil.merge(result, scriptResult);
}
}
return result;
}
public static Map<String, Object> convertPath(Map<String, Object> fixed, boolean supportMultiLevels) {
ONode target = ONode.load(new HashMap());
if (fixed.isEmpty()) {