View Source Jsonpatch.Operation.Remove (Jsonpatch v2.2.1)
A JSON patch remove operation is responsible for removing values.
Examples
iex> remove = %Jsonpatch.Operation.Remove{path: "/a/b"}
iex> target = %{"a" => %{"b" => %{"c" => "Bob"}}, "d" => false}
iex> Jsonpatch.Operation.Remove.apply(remove, target, [])
{:ok, %{"a" => %{}, "d" => false}}
iex> remove = %Jsonpatch.Operation.Remove{path: "/a/b"}
iex> target = %{"a" => %{"b" => nil}, "d" => false}
iex> Jsonpatch.Operation.Remove.apply(remove, target, [])
{:ok, %{"a" => %{}, "d" => false}}
Summary
Types
@type t() :: %Jsonpatch.Operation.Remove{path: String.t()}
Functions
@spec apply( Jsonpatch.t(), target :: Jsonpatch.Types.json_container(), Jsonpatch.Types.opts() ) :: {:ok, Jsonpatch.Types.json_container()} | Jsonpatch.Types.error()