In this assignment, you will design and build a small REST API for personal notes using Spring Boot. The idea is simple. The API allows a client to create notes, list notes, filter notes, view one note, replace a note, delete a note, and receive clear validation errors when the request body is invalid.
You will start by designing the API contract, applying what you learned about REST APIs. Then you will implement it with models, controllers, and DTOs. Validate it using Jakarta Bean Validation.
Create a new project with Spring Initializr: https://start.spring.io
NotesAPIcom.{yourGroupId/githubTag}Design and implement an API based on below requirements.
API_DESIGN.md documents all required endpoints before implementationPOST /api/v1/notesGET /api/v1/notestagpinned=truePUTDELETERefactor your API to be using OpenAPI spec:
Write the OpenAPI spec file for your API.
NotesAPI_v1-supplied.yaml , placed under src/main/resourcesMove all your validation to the spec file.
Add the openapi-generator-maven-plugin
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
mvn compile , your DTOs and API interfaces are generated and can be imported.<interfaceOnly>true</interfaceOnly> so that only an interface for your controllers are generated.Adjust controller to extend the Api interface instead.
Remove your DTOs and use the generated ones instead.
<aside> 💭
For designing the API, you can either do so using markdown or OpenAPI specification. Depending on your choice, please create the file as follows:
NotesAPI_v1-supplied.yaml under src/main/resources/specsAPI_DESIGN.md file in the project root.You can also do the design in Markdown then move to OpenAPI spec.
</aside>
Follow the Assignment submission guide to learn how to submit the assignment
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.