From Web Request to the First API
Observe HTTP and JSON and connect them to a directly executable Spring Boot API.
- [Required] Define and implement the contract so that POST /todos returns 201 with the created id, title, and completed status for valid input, and a 400 common error for invalid input.
- [Required] GET /todos/{id} must return 200 for an existing Todo and a 404 common error for a non-existent id, and these three boundaries must be fixed with integration tests in the actual application context.
- [Required] Explain the roles of DispatcherServlet, validation, and HttpMessageConverter in the process from a request becoming a controller argument to becoming a JSON response, by linking them to your own code and tests.
- [Optional Extension] Replace the memory storage with H2·JdbcTemplate storage and verify that the same API contract tests are maintained.
Submission Evidence · Executable API code implementing 201, 400, and 404 contracts · Integration test results for success, validation failure, and 404 executed in an actual application context · Explanation of the request flow citing your own files and tests · Answers to this week's evidence-based questions 1–5 · Commits and verification results reflecting review feedback, or a record of "no feedback" if none was received
함께 답할 근거형 질문 5개
- Through what process does an HTTP request become an argument for a controller method?
- Who converts Java objects into JSON responses, and how did you verify that fact?
- What is the reason for not using direct branching in the controller code to handle input validation failures?
- What were the boundaries that absolutely had to be verified through integration testing rather than unit testing?
- What is the part of the current API contract most likely to break first, and what is the method for verifying it?


