Chapter 4. Data Representation
We looked at how to build a RESTful endpoint in the previous chapter. We also briefly discussed how the data is represented in REST responses. In this chapter, we will expand on these discussions and cover the following topics:
- The Data-Transfer-Object design pattern
- Controlling the responses format in JSON
- Tips on formatting responses
- API evolutions
Before we delve into the specifics of how to control our JSON responses, let's first take a look at the DTO design pattern.