Documenting APIs with the OpenAPI Specification
In the previous chapter, we learned how to develop our Spring Boot application. First, we configured our application to run on the server using IntelliJ. Then, we developed the different parts of the REST application, such as the models and entities, which serve as the objects; the services, which hold the business logic and call the JPA repository to perform CRUD operations in the database; and the controllers, which define the endpoints. We also learned how to apply Redis, which adds a caching mechanism to improve the performance of our REST APIs.
This chapter will focus on creating the documentation for our Spring Boot project. We will focus on configuring springdoc-openapi
and Swagger UI and generating documentation on the fly for the endpoints that we have developed.
In this chapter, we will cover the following topics:
- Setting up
springdoc-openapi
- Setting up Swagger UI