File: README.md

package info (click to toggle)
rust-does-it-json 0.0.4-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 148 kB
  • sloc: makefile: 2
file content (15 lines) | stat: -rw-r--r-- 467 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# 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.

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

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