Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[type:fix]fix ReqeustMappingPlugin refactoring request body error #5922

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ private String modifyBody(final String jsonValue) {
this.ruleHandle.getAddBodyKeys().forEach(info -> context.put(info.getPath(), info.getKey(), info.getValue()));
}
if (CollectionUtils.isNotEmpty(this.ruleHandle.getReplaceBodyKeys())) {
this.ruleHandle.getReplaceBodyKeys().forEach(info -> context.renameKey(info.getPath(), info.getKey(), info.getValue()));
this.ruleHandle.getReplaceBodyKeys().forEach(info -> context.put(info.getPath(), info.getKey(), info.getValue()));
}
if (CollectionUtils.isNotEmpty(this.ruleHandle.getRemoveBodyKeys())) {
this.ruleHandle.getRemoveBodyKeys().forEach(context::delete);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ default String operation(final String jsonValue, final ParamMappingRuleHandle pa
DocumentContext context = JsonPath.parse(jsonValue);
operation(context, paramMappingRuleHandle);
if (!CollectionUtils.isEmpty(paramMappingRuleHandle.getReplaceParameterKeys())) {
paramMappingRuleHandle.getReplaceParameterKeys().forEach(info -> context.renameKey(info.getPath(), info.getKey(), info.getValue()));
paramMappingRuleHandle.getReplaceParameterKeys().forEach(info -> context.put(info.getPath(), info.getKey(), info.getValue()));
}
if (!CollectionUtils.isEmpty(paramMappingRuleHandle.getRemoveParameterKeys())) {
paramMappingRuleHandle.getRemoveParameterKeys().forEach(context::delete);
Expand Down
Loading