| There is a Java class with generics:
@Data
public class GenericClass<T extends Number> {
private T field;
}
There is ValueExtractor defined for this class:
public class GenericClassValueExtractor implements ValueExtractor<GenericClass<@ExtractedValue ?>> {
@Override
public void extractValues(GenericClass<?> originalValue, ValueReceiver receiver) {
receiver.value( "field", originalValue.getField() );
}
}
And there is field declaration in another class and validation works fine for this case:
@Valid
private GenericClass<@Max(3) Integer> genericClass;
Issue is with the following case. There is another class which extends GenericClass:
public class GenericClassImpl extends GenericClass<@Max(3) Integer> {
}
There is another class where field with GenericClassImpl is declared:
@Valid
private GenericClassImpl genericClassImpl;
And validation is not taking into consideration this @Max constrain in this case. |