How to add Swagger to Spring Boot in 1 minute

tanut aran
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.

--

--

tanut aran
tanut aran

Written by tanut aran

Co-founder and Coder at work !

No responses yet