This crate provides a Valid type that can be used in combination with Json, Path, Query, and Form types to validate the entities that implement the Validate trait.
shell
cargo add axum-valid
```rust use validator::Validate; use serde::Deserialize; use axum_valid::Valid;
pub struct Pager { #[validate(range(min = 1, max = 50))] pub pagesize: usize, #[validate(range(min = 1))] pub pageno: usize, }
pub async fn getpagebyquery(
Valid(Query(pager)): Valid
pub async fn getpagebyjson(
Valid(Json(pager)): Valid