In my Spring project I have a POJO class with a property for a CMYK color. I want this property to be represented by a JSON array with exactly 4 floating-point numbers. Each
We implemented container element constraints in Hibernate Validator 6.0.x.
So upgrade to Hibernate Validator 6.0.x (6.0.9.Final is the latest) and Bean Validation 2.0.1 and do as follows:
@Size(...)
private List<@DecimalMin(...) @DecimalMax(...) BigDecimal> cmykColor;
Be careful, the groupId of Hibernate Validator 6.0 is org.hibernate.validator.