Integrate Swagger with Spring boot application for RESTful API documentation-Lab 4

Hi Readers,

I am happy to post another blog post on how to integrate swagger with Spring boot application for RESTful API documentation.

You have created a RESTful project(say) and like to integrate swagger for representing your RESTful API then this post is for you.

In pom.xml add the below dependency

 io.springfox
 springfox-swagger2
 2.2.2
 io.springfox
 springfox-swagger-ui
 2.2.2

Create a swagger config class similar to this.

Inside the predicate method, add your request mapping path.

Take a maven build and run as spring boot app.

Open a browser and type the below url.

http://localhost:8080/swagger-ui.html

swaggerprojectsjosepraveen1.PNG

From the above diagram the highlighted ones points to my @RequestMapping value of my controller.

Let me know your thoughts and experiences on how to integrate swagger with Spring boot application for RESTful API documentation.

Happy Learning !!

Advertisements

3 thoughts on “Integrate Swagger with Spring boot application for RESTful API documentation-Lab 4”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s