Jsonpatch.Operation.Copy (Jsonpatch v0.12.0) View Source

Represents the handling of JSON patches with a copy operation.

Examples

iex> copy = %Jsonpatch.Operation.Copy{from: "/a/b", path: "/a/e"}
iex> target = %{"a" => %{"b" => %{"c" => "Bob"}}, "d" => false}
iex> Jsonpatch.Operation.apply_op(copy, target)
%{"a" => %{"b" => %{"c" => "Bob"}, "e" => %{"c" => "Bob"}}, "d" => false}

Link to this section Summary

Link to this section Types

Specs

t() :: %Jsonpatch.Operation.Copy{from: String.t(), path: String.t()}