Spring Web

Exercise: Todo REST Features

  1. Clone the GitLab repository Todo.
  2. Add the Jackson libraries tools.jackson.dataformat:jackson-dataformat-xml and tools.jackson.dataformat:jackson-dataformat-csv as Maven dependencies to the REST service.
  3. 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.
  4. Implement a filter LoggingFilter that extends the HttpFilter class and logs all HTTP requests and responses.
  5. Implement a filter AuthorizationFilter that verifies that each API request contains a header with an API key.
  6. 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.
  7. Ensure that the REST interface can also be called by JavaScript code originating from any other server.
  8. Add the SpringDoc library as Maven dependency and Swagger annotations to the controller, and review the generated OpenAPI documentation.

Solution