Crate json_plus[][src]

Expand description

json_plus

This crate provides JSON helper functions beyond Serialization & Deserialization such as diff, merge, ...

use json_plus::diff;
use serde_json::json;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let old = json!({"key":"old value", "arr":[]});
    let new = json!({"key":"new value", "arr":[]});

    let diffed = diff(&old, &new).unwrap();
    println!("{}", diffed.to_string());
    Ok(())
}

Enums

Specifies the type of strip operation to perform using Bitwise OR eg. Strip::Nulls | Strip::Empties

Functions

provides a new Value containing the differences between the old and new.

merges the patch Value on top of the base.

Strips the provided value of specified Strip enum type.