Defining responses and the data model exposed by the API
In the previous recipe, we created a very simple RESTful API. To develop a RESTful API that provides a positive user experience for its consumers, it is essential to incorporate both standard response codes and a consistent data model. In this recipe, we will enhance the previous RESTful API by returning standard response codes and creating a data model for our players endpoint.
Getting ready
You can use the project generated in the previous recipe or download the sample from the GitHub repository: https://github.com/PacktPublishing/Spring-Boot-3.0-Cookbook/.
You can find the code to start this exercise in the chapter1/recipe1-2/start
folder.
How to do it...
In this recipe, we will create a folder structure to contain different types of classes for our project. We will define a data model to expose in our RESTful API, along with a service to provide the operations needed by the API.
Note that all of the content...