Setting up Swagger UI
Swagger UI is a documentation tool that allows users to call the available APIs in your project directly from a browser. This is a more interactive tool that enables a more detailed and practical use of the APIs. Swagger UI is also open source, enabling more communities to support the tool.
Installing and using Swagger UI
Swagger UI is already included under the springdoc-openapi-ui
dependency. We have already included the OpenAPI extension code by adding the following code:
<dependency> <groupId>org.springdoc</groupId> <artifactId>springdoc-openapi-ui</artifactId> <version>1.6.4</version> </dependency>
The OpenAPI dependency includes the Swagger UI extension; we can access the UI with the following URL: http://localhost:8080/swagger-ui.html
. This will open the Swagger UI’s OpenAPI definition...