jsonpatch_rs

Crates.iojsonpatch_rs
lib.rsjsonpatch_rs
version0.1.0
sourcesrc
created_at2023-03-12 08:46:53.449687
updated_at2023-03-12 08:46:53.449687
descriptionJSON Patch implementation in Rust
homepagehttps://github.com/Nero5023/jsondiffpatch.rs
repositoryhttps://github.com/Nero5023/jsondiffpatch.rs
max_upload_size
id807888
size22,227
Nero (Nero5023)

documentation

https://github.com/Nero5023/jsondiffpatch.rs

README

patch

USAGE:
    jsondiffpath-cli patch <ORIGINAL_JSON> <PATCH_JSON>

ARGS:
    <ORIGINAL_JSON>
    <PATCH_JSON>

OPTIONS:

<ORIGINAL_JSON> is the base file to apply to the patch

<PATCH_JSON> is the patch file to apply to the base json (followed by JSON-Patch RFC6902)

jsondiffpatch-cli patch [left.json] [right.json]

e.g.

ORIGINAL_JSON:

{
    "foo": "Hello World",
    "bar": "Unknown"
}

PATCH_JSON:

[
    { "op": "replace", "path": "/foo", "value": "new value" },
    { "op": "add", "path": "/baz", "value": "added value" },
    { "op": "remove", "path": "/bar" }
]

result:

{
  "baz": "added value",
  "foo": "new value"
}
Commit count: 107

cargo fmt