Spring Boot 3 Crash Course Part 4: REST APIs and Spring Magic

Ben Meehan
8 min readNov 21, 2023

In the last part, we explored how to store, retrieve, modify and delete data easily using Spring Boot. This part will take over from where we left off and make use of the things we learned to create a REST API.

Link to part 3

Part 5 is now available: Here

Table of Contents:

  1. Introduction to REST APIs and Spring Magic
  2. Property Entity and Repository
  3. Service Layer
  4. REST API Basics
  • Inserting Data
  • Fetching Data
  • Query and URL Parameters
  • Updating and Deleting

5. Jackson: Handling JSON

6. More Spring REST Magic

Airbnb REST API:

Let’s build a CRUD API for a property lease/lent site like Airbnb.

Start by creating a new spring-boot project just like we have done before from https://start.spring.io/.

Now lets create our Property Entity and a Repository implementation for it.

Here is how the Property Entity looks like

import javax.persistence.*;

@Entity
@Table(name =…

--

--

Ben Meehan

Software Engineer at Razorpay. Sharing knowledge and experiences.