k3s/vendor/github.com/evanphx/json-patch
Mikkel Oscar Lyderik Larsen c02484d380 vendor: Update github.com/evanphx/json-patch
Updates github.com/evanphx/json-patch dependency to a version that
doesn't crash when handling an invalid json patch.

Includes fix from https://github.com/evanphx/json-patch/pull/35

Fix #40218
2017-03-14 15:56:55 -04:00
..
.travis.yml
LICENSE
README.md
merge.go vendor: Update github.com/evanphx/json-patch 2017-03-14 15:56:55 -04:00
patch.go vendor: Update github.com/evanphx/json-patch 2017-03-14 15:56:55 -04: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)