Spring Boot 3 Crash Course Part 4: REST APIs and Spring Magic
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.
Part 5 is now available: Here
Table of Contents:
- Introduction to REST APIs and Spring Magic
- Property Entity and Repository
- Service Layer
- 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 =…