Jsonpatch v0.6.2 Jsonpatch.Operation.Remove View Source

A JSON patch remove operation is responsible for removing values.

Link to this section Summary

Functions

Removes the element referenced by the JSON patch path.

Link to this section Types

Specs

t() :: %Jsonpatch.Operation.Remove{path: String.t()}

Link to this section Functions

Link to this function

apply_op(remove, target)

View Source

Specs

apply_op(t(), map()) :: map() | :error

Removes the element referenced by the JSON patch path.

Examples

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