The aeson-diff package

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain]

This is a small library for working with changes to JSON documents. It includes a library and two command-line executables in the style of the diff(1) and patch(1) commands available on many systems.


[Skip to ReadMe]

Properties

Versions0.1.1.1, 0.1.1.2, 0.1.1.3, 1.0.0.0, 1.0.0.1, 1.1.0.0, 1.1.0.2, 1.1.0.2, 1.1.0.3, 1.1.0.4
Change logCHANGELOG.md
Dependenciesaeson, aeson-diff, base (>=4.5 && <4.10), bytestring (>=0.10), edit-distance-vector, hashable, mtl, optparse-applicative, scientific, text, unordered-containers, vector [details]
LicenseBSD3
Copyright(c) 2015 Thomas Sutton and others.
AuthorThomas Sutton
Maintainerme@thomas-sutton.id.au
CategoryJSON, Web, Algorithms
Home pagehttps://github.com/thsutton/aeson-diff
Source repositoryhead: git clone https://github.com/thsutton/aeson-diff
Executablesjson-patch, json-diff
UploadedMon Mar 20 22:45:53 UTC 2017 by ThomasSutton

Modules

[Index]

Downloads

Maintainers' corner

For package maintainers and hackage trustees


Readme for aeson-diff-1.1.0.2

[back to package description]

Aeson Diff

Build Status Hackage Hackage-Deps

This is a small library for working with changes to JSON documents. It includes a library and two executables in the style of diff(1) and patch(1). Patches are themselves JSON Patch documents as specified in RFC 6902.

Installing

The aeson-diff package is written in Haskell and can be installed using the Cabal package management tool, stack, or something similar.

stack install aeson-diff

The command-line tools can then be executed using stack:

stack exec json-diff -- ....
stack exec json-patch -- ....

If you prefer to use Cabal, something like this might do the trick:

cd aeson-diff/
cabal sandbox init
cabal install --dependencies-only
cabal build
sudo mkdir -p /usr/local/bin
sudo cp dist/build/json-*/json-{diff,patch} /usr/local/bin/

Usage

Patch format

aeson-diff supports the JSON Patch format described in RFC 6902.

json-diff command

The json-diff command compares two JSON documents and extracts a patch describing the differences between the first document and the second.

Usage: json-diff [-T|--test-before-remove] [-o|--output OUTPUT] FROM TO
Generate a patch between two JSON documents.

Available options:
    -h,--help                Show this help text
    -T,--test-before-remove  Include a test before each remove.
    -o,--output OUTPUT       Write patch to file OUTPUT.

json-patch command

The json-patch command applies a patch describing changes to be made to a JSON document.

Usage: json-patch [-o|--output OUTPUT] PATCH FROM
Generate a patch between two JSON documents.

Available options:
  -h,--help                Show this help text
  -o,--output OUTPUT       Destination for patched JSON.
  PATCH                    Patch to apply.
  FROM                     JSON file to patch.

aeson-diff library

The aeson-diff library exports as single module: Data.Aeson.Diff. This exports diff and patch functions which do exactly what might be expected:

For more complete information, see the documentation.