#[validate(...)] helper attribute does not coexist with other ident-only (#[foo]) helper attribute. The Test4 struct in the following code produces an compilation error.
// compiles
#[derive(Validate, Foo)]
struct Test1 {
#[validate(nested)]
a: A,
}
// compiles
#[derive(Validate, Foo)]
struct Test2 {
#[validate(nested)]
#[foo(foo)]
a: A,
}
// compiles
#[derive(Validate, Foo)]
struct Test3 {
#[validate(nested)]
#[foo = "foo"]
a: A,
}
// this does not compile
#[derive(Validate, Foo)]
struct Test4 {
#[validate(nested)]
#[foo]
a: A,
}
#[derive(Validate)]
struct A {}
error: You need to set at least one validator on field `a`
= note: If you want nested validation, use `#[validate(nested)]`
--> src/main.rs:26:5
|
26 | #[validate(nested)]
| ^
Anyway, thank you for maintaining this awesome project!
#[validate(...)]
helper attribute does not coexist with other ident-only (#[foo]
) helper attribute. TheTest4
struct in the following code produces an compilation error.https://github.com/naskya/validator-helper-attribute-example/actions/runs/9945289199/job/27473203363
Anyway, thank you for maintaining this awesome project!