

We can use this UI to test out our endpoints: The method names are defined on the right, as you can see. This is the URL where we can observe all rest endpoints which Swagger created:Īs you can see, both of our endpoints are here - hello-resource and user-resource, with their respective methods inside. Now, navigate to localhost:8080/swagger-ui.html. To enable Swagger2 itself, you'll need to add a couple of dependencies to your pom.xml file: io.springfox springfox-swagger2 $

Select your preferred version of Spring Boot and generate it as a Maven project and you're all set! The simplest way to start with a skeleton Spring Boot project, as always, is using Spring Initializr. Integrating Swagger2 into a Spring Boot application is quite fast and easy with the help of some tools we already use day-in and day-out.
