Randgalt / record-builder

Record builder generator for Java records

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Withers ConstraintDeclarationException

nikolavojicic opened this issue · comments

When I want to validate a record as a field of another record which implements With interface, the javax.validation.ConstraintDeclarationException is thrown.

Repro:

@RecordBuilder
public record Request(

  @NotNull
  @Valid
  Part part)

  implements RequestBuilder.With {

  public record Part(@NotBlank String name) {}

}

Error message:

HV000131: A method return value must not be marked for cascaded validation more than once in a class hierarchy, but the following two methods are marked as such: Request#part(), With#part().

It works without With.