Validating Input
Validating request input with Bean Validation: constraint annotations, @Valid, and field-by-field error responses.
Input validation: refusing a bad request before it reaches your business logic. A request body with a blank required field should be rejected before a line of your own code runs, and Spring Boot does that for you once the rules are written as annotations and validation is switched on. It covers the constraint annotations from Jakarta Bean Validation, @Valid, what happens when @Valid is missing, and turning validation errors into a useful response. It leaves out validation groups and writing custom constraints.
Contents
6 cardsnot started