JSR303 data verification, there is no processing of specific message information in the response body

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:
insert image description here

controller plus checksum:
insert image description here

Entity classes add validation:
insert image description here

Run in postman:
insert image description here

Guess you like

Origin blog.csdn.net/weixin_42260782/article/details/127691829