Validating Input

Refusing a bad request before it reaches your business logic.

  • 6 cards
  • 4 questions
  • About 6 min
  • Difficulty
Share

A request body with a blank required field should never reach your business logic, and Spring Boot can refuse it before a single line of your own code runs — if the constraints are annotated and the validation is actually triggered. This topic is both: the constraint annotations from Jakarta Bean Validation, and the one annotation, easy to forget, that makes them do anything at all.

Contents

6 cardsnot started