remove redundant trait bound; add support for validify
This commit is contained in:
@@ -20,6 +20,8 @@ pub mod typed_header;
|
||||
pub mod typed_multipart;
|
||||
#[cfg(feature = "validator")]
|
||||
pub mod validator;
|
||||
#[cfg(feature = "validify")]
|
||||
pub mod validify;
|
||||
#[cfg(feature = "yaml")]
|
||||
pub mod yaml;
|
||||
|
||||
@@ -37,7 +39,7 @@ pub const VALIDATION_ERROR_STATUS: StatusCode = StatusCode::BAD_REQUEST;
|
||||
|
||||
/// Trait for types that can supply a reference that can be validated.
|
||||
///
|
||||
/// Extractor types `T` that implement this trait can be used with `Valid` or `Garde`.
|
||||
/// Extractor types `T` that implement this trait can be used with `Valid`, `Garde` or `Validated`.
|
||||
///
|
||||
pub trait HasValidate {
|
||||
/// Inner type that can be validated for correctness
|
||||
@@ -52,6 +54,11 @@ pub use crate::validator::{Arguments, HasValidateArgs, Valid, ValidEx, ValidReje
|
||||
#[cfg(feature = "garde")]
|
||||
pub use crate::garde::{Garde, GardeRejection};
|
||||
|
||||
#[cfg(feature = "validify")]
|
||||
pub use crate::validify::{
|
||||
HasModify, HasValidify, Modified, PayloadExtractor, Validated, Validified, ValidifyRejection,
|
||||
};
|
||||
|
||||
/// `ValidationRejection` is returned when the validation extractor fails.
|
||||
///
|
||||
/// This enumeration captures two types of errors that can occur when using `Valid`: errors related to the validation
|
||||
|
||||
Reference in New Issue
Block a user