Spring Boot — Swagger2 | Code Factory

Reference Link : Link

Donate : Link

Swagger2 is an open source project used to generate the REST API documents for RESTful web services. It provides a user interface to access our RESTful web services via the web browser.

Required dependency to enable Swagger in your Spring Boot Application.

pom.xml

Add the @EnableSwagger2 annotation in your main Spring Boot application. The @EnableSwagger2 annotation is used to enable the Swagger2 for your Spring Boot application.

Next, create Docket Bean to configure Swagger2 for your Spring Boot application.

SpringBootSwagger2Application.java

Swagger2Controller.java

Start your Spring Boot Application and hit URL http://localhost:8080/swagger-ui.html

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store