How to run Swagger 3 on Spring Boot 3

I had given up and went to use Spring Boot 2.7 after posting the question. But, after seeing Dmitriy’s answer though, I checked Springdoc one last time and found that Springdoc v2 does support Spring Boot 3.

Essentially, one has to place the following in their pom:

   <dependency>
      <groupId>org.springdoc</groupId>
      <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
      <version>2.0.0</version>
   </dependency>

Then one can access the Swagger page using the following URL: http://localhost:8080/swagger-ui.html (Don’t forget to add context path if you need it). For some reason, when opening, it redirects to http://localhost:8080/swagger-ui/index.html although going for that initially returned 404…

Leave a Comment