Member-only story

Swagger Implementation -SpringBoot

Open-source framework

Swati Sinha
2 min readSep 1, 2024

Swagger, that helps you design, build ,document, and consume RESTful web services. In Spring-Boot,Swagger can be integrated using the springdoc-openapi library, which generates interactive API documentation from your code annotations.

Photo by Carl Gelin on Unsplash

Add the below dependency in the Pom.xml

<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
<version>2.4.0</version>
</dependency>
#Add the below in Application.properties
springdoc.swagger-ui.path=/swagger-ui.html

Re-Run the application and open the below in the browser

<DNS-URL>/swagger-ui.html

SWAGGER — Index.html
SWAGGER — Index.html

http://<dns-url>/v3/api-docs

{
"openapi": "3.0.1",
"info": {
"title": "OpenAPI definition",
"version": "v0"
},
"servers": [
{
"url": "http://localhost:8080",
"description": "Generated server url"
}
],
"paths": {…

--

--

No responses yet