arbitrary-json

Crates.ioarbitrary-json
lib.rsarbitrary-json
version0.1.1
sourcesrc
created_at2022-01-13 14:30:22.563744
updated_at2022-02-23 11:11:00.54055
descriptionA Json generator based on serde_json and arbitrary
homepage
repositoryhttps://github.com/irevoire/arbitrary-json
max_upload_size
id513322
size10,232
Tamo (irevoire)

documentation

README

Arbitrary JSON

This crate provide a compatibility layer between serde_json and arbitrary. This allow you to generate random valid json when fuzzing your rust code. See the following example:

#![no_main]
use arbitrary_json::ArbitraryValue;
use libfuzzer_sys::fuzz_target;

fuzz_target!(|data: ArbitraryValue| {
    // call your very complex code here
    if data["truc"] == serde_json::json!(42) {
        panic!("Found the magic value");
    }
});
Commit count: 5

cargo fmt