Card 06/ 06

RecapDifficulty: Advanced1 min

What This Topic Established

Jakarta Bean Validation constraints — @NotBlank, @Min, @Size, @Pattern and others — live as annotations on a DTO's fields. @Valid on the controller parameter is what actually triggers the check; verified, leaving it off means the exact same annotations do nothing.

A failed validation throws MethodArgumentNotValidException, and its BindingResult carries every field error — catching it turns a bare 400 into a body naming which fields were wrong and why, verified against a real response.