@Data
public class TestRequest2 implements IClientMessage {
@Valid
private PassGenericType<@NotNull Integer> passGenericType;
}
@Data
public class PassGenericType<T extends Number> {
@Valid
private GenericClassWithMultipleFields<T> noConstraints;
@Valid
private GenericClassWithMultipleFields<@Min(1) T> minConstraint;
}
@Data
public class GenericClassWithMultipleFields<T extends Number> {
@Max(3)
private T f1;
@Max(5)
private T f2;
}
I have @NotNull annotation declared on generic type of PassGenericType, but I get 'must not be null' for passGenericType.noConstraints path for some reason. I would expect to have it triggered in following case:
@Data
public class PassGenericType<T extends Number> {
@Valid
@NotNull
private GenericClassWithMultipleFields<T> noConstraints;
@Valid
private GenericClassWithMultipleFields<@Min(1) T> minConstraint;
}
|