Java Annotations
Introduction to REST
Spring Boot Setup
Writing Endpoints
Message Formats
Input Validation
Practice
Assignment
Back end Track
Under construction
<aside>
🚧
This page is currently under construction. Please check back later.
</aside>
Implementation plan:
- Why validate input — never trust the client
- Adding the
spring-boot-starter-validation dependency
- Bean Validation annotations:
@NotNull, @NotBlank, @Size, @Min, @Max, @Email, @Pattern
- Applying annotations to DTO fields
@Valid annotation on @RequestBody parameters
- What happens when validation fails (default behavior)
- Customizing validation error responses with
@ExceptionHandler
- Nested object validation
- Exercise: add validation to existing endpoints
The HackYourFuture curriculum is licensed under CC BY-NC-SA 4.0

*https://hackyourfuture.net/*
Found a mistake or have a suggestion? Let us know in the feedback form.