Crates.io | arbitrary-json |
lib.rs | arbitrary-json |
version | 0.1.1 |
source | src |
created_at | 2022-01-13 14:30:22.563744 |
updated_at | 2022-02-23 11:11:00.54055 |
description | A Json generator based on serde_json and arbitrary |
homepage | |
repository | https://github.com/irevoire/arbitrary-json |
max_upload_size | |
id | 513322 |
size | 10,232 |
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");
}
});