My springboot version is 2.3.7. I know that spring-boot-starter-validation is not a transitive dependency of spring-boot-starter-web. But even after adding it separately my annotations are not working.
//below dependency i have added in build.gradle compile 'org.springframework.boot:spring-boot-starter-validation'
//sample class for which I want error when requested
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
@NoArgsConstructor
@RequiredArgsConstructor(staticName = "of")
public class UpdateRequest {
@NotNull
@NonNull
private BigDecimal number;
}
Here, lombok @NonNull is working but @NotNull is not. Nor other javax validators. What else is I am missing here?