| Vulnerabilities | |||||
|---|---|---|---|---|---|
| Version | Suggest | Low | Medium | High | Critical |
| 4.1.0 | 0 | 0 | 0 | 0 | 0 |
| 4.0.0 | 0 | 0 | 0 | 0 | 0 |
| 3.1.0 | 0 | 0 | 0 | 0 | 0 |
| 3.0.1 | 0 | 0 | 0 | 0 | 0 |
| 3.0.0 | 0 | 0 | 0 | 0 | 0 |
| 2.0.0 | 0 | 0 | 0 | 0 | 0 |
| 1.4.0 | 0 | 0 | 0 | 0 | 0 |
| 1.3.0 | 0 | 0 | 0 | 0 | 0 |
| 1.2.0 | 0 | 0 | 0 | 0 | 0 |
| 1.1.0 | 0 | 0 | 0 | 0 | 0 |
| 1.0.0 | 0 | 0 | 0 | 0 | 0 |
| 0.3.0 | 0 | 0 | 0 | 0 | 0 |
| 0.2.7 | 0 | 0 | 0 | 0 | 0 |
| 0.2.6 | 0 | 0 | 0 | 0 | 0 |
| 0.2.5 | 0 | 0 | 0 | 0 | 0 |
| 0.2.4 | 0 | 0 | 0 | 0 | 0 |
| 0.2.3 | 0 | 0 | 0 | 0 | 0 |
| 0.2.2 | 0 | 0 | 0 | 0 | 0 |
| 0.2.1 | 0 | 0 | 0 | 0 | 0 |
| 0.2.0 | 0 | 0 | 0 | 0 | 0 |
| 0.1.0 | 0 | 0 | 0 | 0 | 0 |
4.1.0 - This version may not be safe as it has not been updated for a long time. Find out if your coding project uses this component and get notified of any reported security vulnerabilities with Meterian-X Open Source Security Platform
Maintain your licence declarations and avoid unwanted licences to protect your IP the way you intended.
Apache-2.0 - Apache License 2.0A JSON Patch (RFC 6902) and JSON Merge Patch (RFC 7396) implementation for Rust.
Add this to your Cargo.toml:
[dependencies]
json-patch = "*"Create and patch document using JSON Patch:
#[macro_use]
use json_patch::{Patch, patch};
use serde_json::{from_value, json};
let mut doc = json!([
{ "name": "Andrew" },
{ "name": "Maxim" }
]);
let p: Patch = from_value(json!([
{ "op": "test", "path": "/0/name", "value": "Andrew" },
{ "op": "add", "path": "/0/happy", "value": true }
])).unwrap();
patch(&mut doc, &p).unwrap();
assert_eq!(doc, json!([
{ "name": "Andrew", "happy": true },
{ "name": "Maxim" }
]));Create and patch document using JSON Merge Patch:
#[macro_use]
use json_patch::merge;
use serde_json::json;
let mut doc = json!({
"title": "Goodbye!",
"author" : {
"givenName" : "John",
"familyName" : "Doe"
},
"tags":[ "example", "sample" ],
"content": "This will be unchanged"
});
let patch = json!({
"title": "Hello!",
"phoneNumber": "+01-123-456-7890",
"author": {
"familyName": null
},
"tags": [ "example" ]
});
merge(&mut doc, &patch);
assert_eq!(doc, json!({
"title": "Hello!",
"author" : {
"givenName" : "John"
},
"tags": [ "example" ],
"content": "This will be unchanged",
"phoneNumber": "+01-123-456-7890"
}));Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.