How to add Swagger to Spring Boot in 1 minute
Mar 24, 2024
Assume that you are using Mavan
Add spring doc dependencies in the pom.xml
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
<version>2.4.0</version>
</dependency>
Then mvn install
and mvn spring-boot:run
again
Then you can see the Swagger screen automatically in this URL
http://localhost:8080/swagger-ui/index.html
For more information you can visit https://springdoc.org/ here.