Open akkie opened 8 months ago
Specifying a custom Error code for Custom Validation checks fails. eg
#[derive(Validate, Deserialize)]
pub struct ExampleStruct {
#[validate(custom = "custom_check", code = "Custom error")]
foo: String,
}
When using a custom validator like this, when a code is specified, Compiler errors with "validate not implemented for this struct"
The bellow example works just fine however.
#[derive(Validate, Deserialize)]
pub struct ExampleStruct {
#[validate(custom = "custom_check")
foo: String,
}
Can you check with https://github.com/Keats/validator/pull/249 ?
The documentation indicates that the code can be overridden for a custom validator.
https://github.com/akkie/validator?tab=readme-ov-file#message-and-code
But this doesn't work. There is also no test for it.