Jsonpatch v0.8.0 Jsonpatch.Operation.Add View Source

The add operation is the operation for adding (as you might guess) values to a map or struct.

Examples

iex> add = %Jsonpatch.Operation.Add{path: "/a/b", value: 1}
iex> target = %{"a" => %{"c" => false}}
iex> Jsonpatch.Operation.apply_op(add, target)
%{"a" => %{"b" => 1, "c" => false}}

Link to this section Summary

Link to this section Types

Specs

t() :: %Jsonpatch.Operation.Add{path: String.t(), value: any()}