Spring Web Services
Exercise: Todo REST Service Features
The objective of this exercise is to add some additional features to the RESTful todo web service.
Assignment
- Add the Jackson library
com.fasterxml.jackson.dataformat:jackson-dataformat-xml
as dependency such that XML is a supported data format
- Implement and add a message converter
TodoCSVMessageConverter
that can produce a todo list in CSV format
- Implement and register a filter
AuthenticationFilter
by extending HttpFilter that verifies an AuthToken
header and returns the error status 401 (Unauthorized) if the header is missing or invalid
- Add Bean Validation constraints to the method parameters such that identifiers must be positive and todos without or with an empty title are rejected
- Add the SpringDoc library and provide the controller with Swagger annotations to generate an OpenAPI documentation
Solution