Jsonpatch v0.6.1 Jsonpatch.Operation.Copy View Source
Represents the handling of JSON patches with a copy operation.
Link to this section Summary
Functions
Copy the element referenced by the JSON patch path :from to to the other given path.
Link to this section Types
Specs
Link to this section Functions
Specs
Copy the element referenced by the JSON patch path :from to to the other given path.
Examples
iex> copy = %Jsonpatch.Operation.Copy{from: "/a/b", path: "/a/e"}
iex> target = %{"a" => %{"b" => %{"c" => "Bob"}}, "d" => false}
iex> Jsonpatch.Operation.Copy.apply_op(copy, target)
%{"a" => %{"b" => %{"c" => "Bob"}, "e" => %{"c" => "Bob"}}, "d" => false}