Member-only story
From Zero to Service — A Guide on Creating an API using Java Spring Boot
In this post, we’ll go through all the steps required to get a Java Spring Boot service up and running. At a pretty high level, Spring Boot is an open-source framework that simplifies tasks such as dependency injection and assists with building APIs.
The Goal
We will be implementing a service that will take care of creating, updating, and retrieving cars from an inventory. In this example, if we follow HTTP and REST standards, we can implement this using two API requests.
- For the request to retrieve all cars in the inventory, we will use a method of GET. Its route will be
/v1/cars
and it will return a list of cars. - For the request to create and update cars, we will use a method of PUT. Its route will be
/v1/cars/{carId}
, where the{carId}
parameter is the car's unique identifier. This request will have as part of its request body the full definition of the car you are going to create or update. For simplicity purposes, a car will only have amake
and anid
property.
The Project
We will proceed now to create our service. One of the simplest ways to achieve this task is to go to Here you can download an empty project that will come with the right dependencies…