Reputation: 1
I'm working on a Spring Boot application and trying to integrate Swagger UI using the springdoc-openapi-ui dependency. Here's my setup:
Spring Boot version: 2.x.x / 3.x.x (3.4.1) springdoc-openapi-ui version: 1.7.0
I added the following dependency to my pom.xml:
xml
org.springdoc
springdoc-openapi-ui
3.4.1
I also set up the following configurations in my application.properties:
properties
springdoc.api-docs.path=/v3/api-docs
springdoc.swagger-ui.path=/swagger-ui.html
However, when I run my application and try to access Swagger UI at http://localhost:8080/swagger-ui.html, it does not load properly. Either:
I get a 404 error. The page loads but shows a blank UI. It doesn't reflect my API endpoints. Here’s what I’ve tried so far:
Verified that the application is running without errors. Checked if "/v3/api-docs" is not accessible Cleared browser cache and used incognito mode. Rebuilt the project to ensure dependencies are correctly imported.
Upvotes: 0
Views: 830
Reputation: 1
Use the version 2.7.0-RC1 it worked for me, 2.8.3 and 2.7.0 are not. I don't know why:
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
<version>2.7.0-RC1</version>
</dependency>
Upvotes: 0