RestClient exceptions and validation
In this section, we will introduce RestClientfor making API calls, and we will also look at how to handle exceptions globally in the application using @RestControllerAdvice with custom error messages (using problem details as described in RFC 7807).
Finally, we will look at how to use Bean validation to validate input at the application boundary.
Before class
Practical requirements
Recommended reading and videos
- RestClient for API calls: RestClient Tutorial
- Java exceptions: Java Exceptions Guide
- Exception handling in Spring: Spring Exception Handling
- Bean validation: Spring Boot Bean Validation
- Java interfaces (refresh): Java Interfaces Guide
Extra resources
During class
Demos used in class:
- TBD
After class
Finish the exercises.