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