1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
[](https://crates.io/crates/vld-web)
[](https://docs.rs/vld-web)
Request extractors and JSON error responses that validate with [vld](https://crates.io/crates/vld) schemas, one module per web framework.
```toml
[dependencies]
vld = "0.8"
vld-web = { version = "0.8", features = ["axum"] }
```
```rust
use axum::{routing::post, Router};
use vld_web::axum::VldJson;
vld::schema! {
}
async fn create(VldJson(user): VldJson<CreateUser>) -> String {
}
let app: Router = Router::new().route("/users", post(create));
```
No feature is on by default; any set can be enabled together.
- -
MIT