Merge pull request #23 from noshishiRust/misc/update/validator-crate
update validator crate 0.17.0 -> 0.18.0
This commit is contained in:
@@ -27,7 +27,7 @@ features = ["full", "aide"]
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
axum = { version = "0.7.3", default-features = false }
|
axum = { version = "0.7.3", default-features = false }
|
||||||
garde = { version = "0.18.0", optional = true }
|
garde = { version = "0.18.0", optional = true }
|
||||||
validator = { version = "0.17.0", optional = true }
|
validator = { version = "0.18.0", optional = true }
|
||||||
validify = { version = "1.3.0", optional = true }
|
validify = { version = "1.3.0", optional = true }
|
||||||
|
|
||||||
[dependencies.axum-extra]
|
[dependencies.axum-extra]
|
||||||
@@ -57,7 +57,7 @@ axum = { version = "0.7.1", features = ["macros"] }
|
|||||||
tokio = { version = "1.34.0", features = ["full"] }
|
tokio = { version = "1.34.0", features = ["full"] }
|
||||||
reqwest = { version = "0.11.23", features = ["json", "multipart"] }
|
reqwest = { version = "0.11.23", features = ["json", "multipart"] }
|
||||||
serde = { version = "1.0.195", features = ["derive"] }
|
serde = { version = "1.0.195", features = ["derive"] }
|
||||||
validator = { version = "0.17.0", features = ["derive"] }
|
validator = { version = "0.18.0", features = ["derive"] }
|
||||||
garde = { version = "0.18.0", features = ["serde", "derive"] }
|
garde = { version = "0.18.0", features = ["serde", "derive"] }
|
||||||
serde_json = "1.0.108"
|
serde_json = "1.0.108"
|
||||||
serde_yaml = "0.9.27"
|
serde_yaml = "0.9.27"
|
||||||
|
|||||||
@@ -252,8 +252,8 @@ pub mod tests {
|
|||||||
assert_eq!(&inner, v.deref());
|
assert_eq!(&inner, v.deref());
|
||||||
assert_eq!(inner, v.into_inner());
|
assert_eq!(inner, v.into_inner());
|
||||||
|
|
||||||
fn validate(v: &i32, args: &DataVA) -> Result<(), ValidationError> {
|
fn validate(v: i32, args: &DataVA) -> Result<(), ValidationError> {
|
||||||
assert!(*v < args.a);
|
assert!(v < args.a);
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -47,10 +47,10 @@ pub struct ParametersEx {
|
|||||||
v1: String,
|
v1: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
fn validate_v0(v: &i32, args: &ParametersExValidationArguments) -> Result<(), ValidationError> {
|
fn validate_v0(v: i32, args: &ParametersExValidationArguments) -> Result<(), ValidationError> {
|
||||||
args.inner
|
args.inner
|
||||||
.v0_range
|
.v0_range
|
||||||
.contains(v)
|
.contains(&v)
|
||||||
.then_some(())
|
.then_some(())
|
||||||
.ok_or_else(|| ValidationError::new("v0 is out of range"))
|
.ok_or_else(|| ValidationError::new("v0 is out of range"))
|
||||||
}
|
}
|
||||||
@@ -1208,11 +1208,11 @@ mod extra_typed_path {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn validate_v0(
|
fn validate_v0(
|
||||||
v: &i32,
|
v: i32,
|
||||||
args: &TypedPathParamExValidationArguments,
|
args: &TypedPathParamExValidationArguments,
|
||||||
) -> Result<(), ValidationError> {
|
) -> Result<(), ValidationError> {
|
||||||
args.v0_range
|
args.v0_range
|
||||||
.contains(v)
|
.contains(&v)
|
||||||
.then_some(())
|
.then_some(())
|
||||||
.ok_or_else(|| ValidationError::new("v0 is out of range"))
|
.ok_or_else(|| ValidationError::new("v0 is out of range"))
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user