JSR303 data verification, there is no specific message information processing in the response body, first introduce the relevant dependencies in the common pom file:
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>6.0.18.Final</version>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>2.0.1.Final</version>
</dependency>
Add the following configuration to the yml file of the product module:
controller plus checksum:
Entity classes add validation:
Run in postman: