# axum_serde_valid
[](https://crates.io/crates/axum_serde_valid)
[](https://docs.rs/axum_serde_valid)
[](https://github.com/Naereen/StrapDown.js/blob/master/LICENSE)
This crate is a Rust library for providing validation mechanism
to [axum](https://github.com/tokio-rs/axum) with [serde_valid](https://github.com/yassun4dev/serde_valid) crate.
More information about this crate can be found in the [crate documentation](https://docs.rs/axum_serde_valid).
### Installation
This crate works with Cargo and can be found on [crates.io](https://crates.io/crates/axum_serde_valid) with a Cargo.toml like:
```toml
[dependencies]
axum = "0.6"
axum_serde_valid = { version = "13", features = ["jsonschema"] }
jsonschema = "^0.16"
schemars = "0.8"
```
### Feature Flags
- `jsonschema` - provides [jsonschema](https://github.com/Stranger6667/jsonschema-rs) validation.
- `aide` - support [aide](https://github.com/tamasfe/aide).
### Example
```rust
use axum::{routing::post, Router};
use axum_serde_valid::Json;
use serde::Deserialize;
#[derive(Deserialize, Validate)]
struct User {
#[validate(max_length = 3)]
name: String,
}
License: MIT