Is it possible to disable automatic validation in Spring

Viewed 853

I have a Spring boot application. My request classes passed to my @RestController contains javax.validation annotations which I cannot change/remove - they come as a 3rd party library. So I want to validate my request objects manually or don't validate them at all. Unfortunately if I add either:

  • spring-boot-starter-validation - to have Validator bean preconfigured or
  • validation-api and hibernate-validator - to create a Validator by myself

Spring automatically enables validation for all my @RestControllers.

Is it possible to disable automatic validation in Spring?

0 Answers
Related