axum_garde

Crates.ioaxum_garde
lib.rsaxum_garde
version0.20.0
sourcesrc
created_at2023-04-02 14:59:54.03685
updated_at2024-07-05 09:47:15.2999
descriptionAxum integration for garde
homepage
repositoryhttps://github.com/jprochazk/garde
max_upload_size
id828154
size75,758
Jan Procházka (jprochazk)

documentation

README

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

Commit count: 302

cargo fmt