Week 4 - Rest APIs

Java Annotations

Introduction to REST

Spring Boot Setup

Writing Endpoints

Message Formats

Input Validation

Practice

Assignment

Back end Track

Week 4 Assignment

Task 1 - Notes API

Overview

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.

Project Setup

Create a new project with Spring Initializr: https://start.spring.io

Settings

Requirements

Design and implement an API based on below requirements.

Scoring Criteria

Bonus

Refactor your API to be using OpenAPI spec:

<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:

You can also do the design in Markdown then move to OpenAPI spec.

</aside>

Submission

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/*

CC BY-NC-SA 4.0 Icons

Built with ❤️ by the HackYourFuture community · Thank you, contributors

Found a mistake or have a suggestion? Let us know in the feedback form.