k3s/vendor/github.com/evanphx/json-patch
Jimmi Dyson 0aec53ae39
godep bump: github.com/evanphx/json-patch
2016-06-09 08:15:25 +01:00
..
.travis.yml Move deps from _workspace/ to vendor/ 2016-05-08 20:30:21 -07:00
LICENSE Move deps from _workspace/ to vendor/ 2016-05-08 20:30:21 -07:00
README.md godep bump: github.com/evanphx/json-patch 2016-06-09 08:15:25 +01:00
merge.go godep bump: github.com/evanphx/json-patch 2016-06-09 08:15:25 +01:00
patch.go godep bump: github.com/evanphx/json-patch 2016-06-09 08:15:25 +01:00

README.md

JSON-Patch

Provides the ability to modify and test a JSON according to a RFC6902 JSON patch and RFC7396 JSON Merge Patch.

Version: 1.0

GoDoc

Build Status

API Usage

  • Given a []byte, obtain a Patch object

    obj, err := jsonpatch.DecodePatch(patch)

  • Apply the patch and get a new document back

    out, err := obj.Apply(doc)

  • Create a JSON Merge Patch document based on two json documents (a to b):

    mergeDoc, err := jsonpatch.CreateMergePatch(a, b)

  • Bonus API: compare documents for structural equality

    jsonpatch.Equal(doca, docb)