diff --git a/crates/serde_valid_derive/src/derive/enum_derive.rs b/crates/serde_valid_derive/src/derive/enum_derive.rs index ba6d1ef..9c9b9a7 100644 --- a/crates/serde_valid_derive/src/derive/enum_derive.rs +++ b/crates/serde_valid_derive/src/derive/enum_derive.rs @@ -137,8 +137,8 @@ fn expand_enum_variant_named_fields_validation( let mut __rule_vec_errors = ::serde_valid::validation::VecErrors::new(); let mut __property_vec_errors_map = ::serde_valid::validation::PropertyVecErrorsMap::new(); - #enum_validates #validates + #enum_validates if !(__rule_vec_errors.is_empty() && __property_vec_errors_map.is_empty()) { Err(#variant_errors)?