4
Writing Business Logic for APIs
You defined API specs using OpenAPI in the previous chapter. API Java interfaces and models were generated by the OpenAPI (Swagger Codegen). In this chapter, you will implement the API’s code in terms of both business logic and data persistence. Here, business logic refers to the actual code you are writing for domain functionalities, which in our case comprise operations performed for e-commerce, such as checking out the shopping cart.
You will write services and repositories for implementation and add hypermedia and entity tags (ETags) to API responses. Hypermedia As The Engine Of Application State (HATEOAS) will be implemented using Spring and Hypertext Application Language (HAL). HAL is one of the standards ...
Get Modern API Development with Spring 6 and Spring Boot 3 - Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.