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

  1. Add the Jackson library com.fasterxml.jackson.dataformat:jackson-dataformat-xml as dependency such that XML is a supported data format
  2. Implement and add a message converter TodoCSVMessageConverter that can produce a todo list in CSV format
  3. 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
  4. Add Bean Validation constraints to the method parameters such that identifiers must be positive and todos without or with an empty title are rejected
  5. Add the SpringDoc library and provide the controller with Swagger annotations to generate an OpenAPI documentation

Solution