19 releases (10 breaking)

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

#1532 in Web programming

Download history 62/week @ 2024-07-22 67/week @ 2024-07-29 78/week @ 2024-08-05 60/week @ 2024-08-12 164/week @ 2024-08-19 176/week @ 2024-08-26 161/week @ 2024-09-02 189/week @ 2024-09-09 179/week @ 2024-09-16 162/week @ 2024-09-23 100/week @ 2024-09-30 76/week @ 2024-10-07 62/week @ 2024-10-14 73/week @ 2024-10-21 56/week @ 2024-10-28 61/week @ 2024-11-04

264 downloads per month

MIT/Apache

120KB
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–10MB
~115K SLoC