Spring Applications

Exercise: Todo REST Features

  1. Add the Jackson libraries tools.jackson.dataformat:jackson-dataformat-xml as Maven dependency to the REST service.
  2. Implement a message converter TodoCsvMessageConverter that can write a todo list in CSV format and expand the controller annotations such that a todo list can be exported as XML or CSV.
  3. Implement a filter LoggingFilter that extends the HttpFilter class and logs the HTTP requests and responses.
  4. Add the spring-boot-starter-validation Maven dependency and provide Bean Validation constraints such that identifiers must be positive, todos must have a non-empty title and due dates are in the present or future.
  5. Add the SpringDoc library as Maven dependency and Swagger annotations to the controller, and review the generated OpenAPI documentation.

Solution