You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@Getter
@SuppressWarnings("FieldMayBeFinal")
@Names(strategy = NameStrategy.HYPHEN_CASE, modifier = NameModifier.TO_LOWER_CASE)
public class ModerationConfig extends OkaeriConfig {
private CapsModerationConfig caps = new CapsModerationConfig();
@Positive
private int exampleField = 6;
@Getter
@SuppressWarnings("FieldMayBeFinal")
@Names(strategy = NameStrategy.HYPHEN_CASE, modifier = NameModifier.TO_LOWER_CASE)
public static class CapsModerationConfig extends OkaeriConfig {
private boolean enable = true;
@Positive
private int length = 6;
@Min(0) @Max(100)
private int percent = 80;
private boolean block = true;
}
}
If I set "exampleField" and "length" to zeros, I get exception only for the field from topper class. If I set to zero "length" only, result is the same.
After giving it some thought (about half a year it seems), I believe this is actually a okaeri-validator limitation (related to OkaeriPoland/okaeri-validator#2) and not something to be fixed in the okaeri-configs directly.
I guess in the meanwhile, validator-jakartaee is a viable alternative. It may require @Valid annotation on the parent field, but that should be all that's needed to get multi level validation working.
Describe the bug
I have such code:
If I set "exampleField" and "length" to zeros, I get exception only for the field from topper class. If I set to zero "length" only, result is the same.
Library version
The text was updated successfully, but these errors were encountered: