Skip to main content

merge

Function merge 

Source
pub fn merge(target: &mut Value, patch: &Value)
Available on crate feature transport only.
Expand description

Applies an RFC 7396 JSON Merge Patch in place.

If the patch is anything other than an object, the result will always be to replace the entire target with the entire patch. Also, it is not possible to patch part of a target that is not an object … null values in the merge patch are given special meaning to indicate the removal of existing values in the target.

This is exported because a hub needs it to apply a patch it is forwarding without knowing the object’s type.