admin管理员组

文章数量:1201362

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.

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.

Share Improve this question asked Jan 22 at 13:34 GURU RAJGURU RAJ 1
Add a comment  | 

1 Answer 1

Reset to default 0

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>

本文标签: