impl HasValidateArgs for all extractors
This commit is contained in:
11
src/yaml.rs
11
src/yaml.rs
@@ -42,9 +42,9 @@
|
||||
//! }
|
||||
//! ```
|
||||
|
||||
use crate::HasValidate;
|
||||
use crate::{HasValidate, HasValidateArgs};
|
||||
use axum_yaml::Yaml;
|
||||
use validator::Validate;
|
||||
use validator::{Validate, ValidateArgs};
|
||||
|
||||
impl<T: Validate> HasValidate for Yaml<T> {
|
||||
type Validate = T;
|
||||
@@ -53,6 +53,13 @@ impl<T: Validate> HasValidate for Yaml<T> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'v, T: ValidateArgs<'v>> HasValidateArgs<'v> for Yaml<T> {
|
||||
type ValidateArgs = T;
|
||||
fn get_validate_args(&self) -> &Self::ValidateArgs {
|
||||
&self.0
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use crate::tests::{ValidTest, ValidTestParameter};
|
||||
|
||||
Reference in New Issue
Block a user