Content
<aside> 💭
Practice exercises are optional and do not need to be submitted
</aside>
For Exercises 1 and 2, use a small Spring Boot project with Spring Web, Lombok, and Validation if needed. You may create a fresh project for each exercise, or keep each exercise in its own feature package inside one practice project.
Choose a simple resource that is either:
e-books, music, images, or similar filesweather-data, event-info, or similar databooks, clothes, tickets, or similar itemsCreate a markdown file named API_DESIGN.md and design the API you would build for that resource.
Choose one pair of resources:
For one resource, start by writing the controller first:
UnsupportedOperationException.For the other resource, start by writing the service first:
Limit each resource to three endpoints: GET all items, POST add a new item, and DELETE delete an item.
After implementing both approaches, answer the following:
Go back to the Categories API you built in Writing Endpoints. Remove any exception handlers except the handler for MethodArgumentNotValidException that we implemented in Input Validation.
Then, from Postman, try sending bad inputs to find more unhandled exceptions. Hint: There are a few.
How many can you find? Can you handle them? What would be an appropriate message?
<aside> 💡
Run your application without debug mode. This makes it easier to see thrown exceptions either in the Postman response or in the application console, near Spring Boot's startup message.
</aside>
While working through the previous exercise, did you find validation scenarios that were missing?
Think in terms of:
List them and implement the missing validations.
The HackYourFuture curriculum is licensed under CC BY-NC-SA 4.0 *https://hackyourfuture.net/*

Built with ❤️ by the HackYourFuture community · Thank you, contributors
Found a mistake or have a suggestion? Let us know in the feedback form.