This commit is contained in:
gengteng
2023-06-06 13:53:47 +08:00
parent aec574b768
commit ba3b23a419
2 changed files with 7 additions and 2 deletions

View File

@@ -1,7 +1,7 @@
[package]
name = "axum-valid"
version = "0.2.0"
description = "Validator for axum"
version = "0.2.1"
description = "Validation tools for axum using the validator library."
authors = ["GengTeng <me@gteng.org>"]
license = "MIT"
homepage = "https://github.com/gengteng/axum-valid"

View File

@@ -1,3 +1,6 @@
#![doc = include_str!("../README.md")]
#![deny(unsafe_code, missing_docs, clippy::unwrap_used)]
use axum::extract::rejection::{FormRejection, JsonRejection, PathRejection, QueryRejection};
use axum::extract::{FromRequest, FromRequestParts, Path, Query};
use axum::http::request::Parts;
@@ -13,7 +16,9 @@ pub struct Valid<T>(pub T);
/// If the valid extractor fails it'll use this "rejection" type.
/// This rejection type can be converted into a response.
pub enum ValidRejection<E> {
/// Validation errors
Valid(ValidationErrors),
/// Inner extractor error
Inner(E),
}