Configuration Auto Generation of Swagger Documentation

 Rest API Documentation - Swagger and Open API


  • 2011: Swagger Specification  and tool were Introduces
  • 2016: Open API Specification Created based on Swagger Specification
    • But Still Swagger tool was exists
  • OpenAPI Specification: this was earlier known as Swagger Specification, this is nothing but  a standard language agnostic interface, to define your Rest API, you can see an open api specification in given below screenshot with openApi 3.0.0 version

  • Swagger UI: Visualize and interact with your REST API
Note: springdoc-openapi java library helps to automate the genration of API documentation for Spring boot Projects

Given below dependancy is use for OpenApi

<dependency>

<groupId>org.springdoc</groupId>

<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>

<version>2.1.0</version>

</dependency>



once added given above dependancy you can able to access swagger UI documentation by given below URL


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

Given Below you can see the documentation for Our Rest API
  • as you can see number of controller classes which we have created is now you can seen in the UI form
  • also there GET POST DELETE and all the different Api End point urls



Comments

Popular posts from this blog

Introduction of RESTful Web Service

Learn JPA and Hibernate

Implementing Dynamic Filtering for Rest API