Skip to content

Leave in DefaultParty minimal set of constrains

Java Validation API attempts to validate constrains on all fields in hiearchy. But in certain circumstances this might lead to false-positive constrain violations, e.g. if password field in DefaultParty would be marked as required it and in children class it would be overriden to bring new constrains validation would always throw error.required on the parent's field.

Another reason to of constrains removal is that there is no way to override them. Instead overriding we append new constrains, even if we use the same annotation. This caused by the way how Java handles annotations.

Merge request reports