20 releases (11 breaking)

new 0.21.0 Dec 21, 2024
0.20.0 Jul 5, 2024
0.19.2 Jun 18, 2024
0.18.0 Jan 28, 2024
0.13.0 Jul 28, 2023

#1577 in Web programming

Download history 161/week @ 2024-08-30 177/week @ 2024-09-06 162/week @ 2024-09-13 197/week @ 2024-09-20 110/week @ 2024-09-27 74/week @ 2024-10-04 75/week @ 2024-10-11 81/week @ 2024-10-18 54/week @ 2024-10-25 53/week @ 2024-11-01 60/week @ 2024-11-08 89/week @ 2024-11-15 159/week @ 2024-11-22 86/week @ 2024-11-29 73/week @ 2024-12-06 91/week @ 2024-12-13

436 downloads per month

MIT/Apache

120KB
2K SLoC

axum_garde

[!WARNING] ⚠️ This crate is deprecated in favor of axum-valid. ⚠️

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
~116K SLoC