Hello, What if i put the @Valid and @validated above the method like in this way in the controller @Valid @Validated //No parameters are passed to both the valid and validated here public ResponseEntity addUser( @RequestBody User user){ //some code } could you please explain this for me Also, I have one more question if i don't write the @Valid in the controller part which you shown in the video and hit the api still i'm able to get the error message for name as "name is mandatory" then what is the difference in keeping the @Valid and without @valid still it is throwing the error message
This is international channel?
Hello, What if i put the @Valid and @validated above the method like in this way in the controller
@Valid
@Validated //No parameters are passed to both the valid and validated here
public ResponseEntity addUser( @RequestBody User user){
//some code
}
could you please explain this for me
Also, I have one more question if i don't write the @Valid in the controller part which you shown in the video and hit the api still i'm able to get the error message for name as "name is mandatory" then what is the difference in keeping the @Valid and without @valid still it is throwing the error message
@Valid is for complete object validation and @Validated is for step level validation.