Loading tutorials
spring-boot-starter-validation dependency and a request DTO with constraint annotations, as in the earlier chapters. It also assumes you can write a basic @RestController.2 min readspring-boot-starter-validation. You should also know the @Valid and @Validated annotations from the previous chapter. Here you will learn which exception each kind of failure raises and what Spring does with it if you do2 min read@Valid on the @RequestBody parameter. It covers what the client receives when validation fails, and how to make that response consistent.2 min readspring-boot-starter-validation dependency on the classpath, and know how @Valid works on a request body. Here you will apply constraints to path variables and query parameters, and handle the exception this produces.2 min read@Valid on a @RequestBody parameter. It covers what happens when the DTO contains other objects or lists of objects.3 min read@NotBlank and @Size, and that you trigger validation with @Valid on a request body. When no standard annotation expresses a rule, you can write your own.2 min read@Valid, and return field errors from a @RestControllerAdvice. It covers how to replace the default messages and move them into property files.2 min read@Valid, and handle MethodArgumentNotValidException. Earlier chapters cover those.2 min read@Valid, and return errors from a @RestControllerAdvice. Those steps are covered in the earlier chapters.2 min read@Valid and handle MethodArgumentNotValidException in a @RestControllerAdvice. You also need to know what a Spring bean is.2 min readCreateUserRequest, UserController and ApiExceptionHandler classes from earlier chapters, and spring-boot-starter-test is on your test classpath.1 min read