Registry / serialization / evanphx-json-patch-v5

evanphx-json-patch-v5

JSON →
library5.9.11gogounverified

Package jsonpatch offers functionality to apply and create JSON Patch (RFC 6902) operations.

go get github.com/evanphx/json-patch/v5
INSTALL
IMPORT
SIG · EVANPHX-JSON-PATCH
E
evanphx-json-patch-v5
serializationgov5.9.11
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

jsonpatch
github.com/evanphx/json-patch/v5

Applies a JSON Patch operation to a JSON document.

package main import ( "fmt" "github.com/evanphx/json-patch/v5" ) func main() { patch, _ := jsonpatch.DecodePatch([]byte(`[{"op":"add","path":"/foo","value":"bar"}]`)) original := []byte(`{}`) result, _ := patch.Apply(original) fmt.Println(string(result)) }
Debug
Known issues
breakingBreaking changes between v4 and v5: the Apply function signature changed.
fix
Update calls from patch.Apply(doc) to patch.Apply(doc) (now returns []byte, error).
affects: >=5.0.0
Upgrade
Version history
5.9.11latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
13 hits · last 30 days
node
12
Resources
evanphx-json-patch-v5 — go get evanphx-json-patch-v5 · libregistry