15 releases (8 breaking)

0.18.0 Jan 28, 2024
0.16.3 Nov 26, 2023
0.13.0 Jul 28, 2023

#1723 in Web programming

Download history 7/week @ 2024-01-01 40/week @ 2024-01-08 88/week @ 2024-01-15 97/week @ 2024-01-22 75/week @ 2024-01-29 27/week @ 2024-02-05 40/week @ 2024-02-12 112/week @ 2024-02-19 278/week @ 2024-02-26 170/week @ 2024-03-04 157/week @ 2024-03-11 103/week @ 2024-03-18 69/week @ 2024-03-25 63/week @ 2024-04-01

404 downloads per month

MIT/Apache

110KB
2K SLoC

axum_garde

Provide garde validation on your axum application.

Getting started

The most important element on this library is WithValidation, a composable extractor that performs validation over some payload contents.

For most validators to work, the application state should implement FromRef for ():

#[derive(Clone)]
struct AppState;

impl axum::extract::FromRef<AppState> for () {
    fn from_ref(_: &AppState) {}
}

Features

Feature Description Default?
json Enables support for axum::extract::Json
form Enables support for axum::extract::Form
query Enables support for axum::extract::Query
axum-extra Enables support for axum_extra::extract::WithRejection and axum_extra::extract::Cached
axum-extra-protobuf Enables support for axum_extra::protobuf::Protobuf
axum-extra-query Enables support for axum_extra::extract::Query
axum-yaml Enables support for axum_yaml::Yaml
axum-msgpack Enables support for axum_msgpack::MsgPack and axum_msgpack::MsgPackRaw

Useful links

Dependencies

~3.5–6.5MB
~119K SLoC