does-it-json

Crates.iodoes-it-json
lib.rsdoes-it-json
version0.0.4
sourcesrc
created_at2022-06-24 19:15:25.319456
updated_at2022-07-10 06:03:07.564677
descriptionCompare serde serialization with the schemars JSON schema
homepage
repositoryhttps://github.com/ahl/does-it-json
max_upload_size
id612567
size37,505
Adam Leventhal (ahl)

documentation

README

Does it JSON?

Simple crate to validate that a type's serialization via serde matches the JSON schema from schemars.

This is particularly useful when hand-rolling (rather than deriving) serde::Serialize and/or schemars::JsonSchema--it can be easy to accidentally have divergence between the two.

let item = MyType::create_somehow();
does_it_json::validate(&item).unwrap();

For best results, apply to a variety of instantiations of your type.

Commit count: 113

cargo fmt