JSONDiff is an Elixir implementation of the diffing element of the JSON Patch format, described in RFC 6902.
This library only handles diffing. For patching, see the wonderful JSONPatch library.
This library only supports add, replace and remove operations.
It is based on the very fast JavaScript library JSON-Patch
iex> JSONDiff.diff(%{"a" => 1}, %{"a" => 2})
[%{"op" => "replace", "path" => "/a", "value" => 2}]
iex> JSONDiff.diff([1], [2])
[%{"op" => "replace", "path" => "/0", "value" => 2}]
# mix.exs
def deps do
[
{:json_diff, "~> 0.1.2"}
]
end
JSONDiff is released under the MIT License, available at LICENSE.txt.