Crate axum_garde

source ·
Expand description

§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

FeatureDescriptionDefault?
jsonEnables support for axum::extract::Json
formEnables support for axum::extract::Form
queryEnables support for axum::extract::Query
axum-extraEnables support for axum_extra::extract::WithRejection and axum_extra::extract::Cached
axum-extra-protobufEnables support for axum_extra::protobuf::Protobuf
axum-extra-queryEnables support for axum_extra::extract::Query
axum-yamlEnables support for axum_yaml::Yaml
axum-msgpackEnables support for axum_msgpack::MsgPack and axum_msgpack::MsgPackRaw

Structs§

Enums§

Traits§

  • Trait for unwrapping extractor’s payloads