Closed nvervelle closed 6 months ago
@nvervelle,
Not reproducible. Feel free to provide a Minimal, Reproducible Example - with HelloController that reproduces the problem.
This ticket will be closed, but can be reopened if your provide the reproducible sample.
@bnasslahsen I'm experiencing the same Problem with SpringBoot 3.2.4 and SpringDoc 2.4.0. The /v3/api-docs
endpoint works, but the /swagger-ui/
doesn't.
I've built a minimum example demonstrating the issue, here: https://github.com/madduci/springdoc-springboot-bug
The bug occurs with Java 17 and Java 21 on Windows 10 with Maven 3.9.6
Hi @bnasslahsen . Can the issue be reopened as an example as been provided demonstrating the problem ?
@nvervelle,
The issue is not reproducible:
@bnasslahsen
Argh, you mean with the provided sample, you do not reproduce ? Can you tell me on which OS you tested ? On my side, the problem occurs on Linux (Ubuntu for my development computer, oracle java image for production). Built with gradle, JDK 20, spring boot 3.2
@nvervelle,
The issue is not reproducible:
interesting. What is your environment (OS / Maven / JDK version)?
I can consistently reproduce the error on my Windows 10 machine
@bnasslahsen , given the differences depending on the OS in the posts above, we tested with our own application, running on docker compose locally, wth springdoc 2.4.0 :
Do you have the ability to test on Linux or Windows ?
@nvervelle,
It's all deployed on Linux https://springdoc.org/#demos
OK :thinking:
Update: with the 2.5.0 Version, it works for me again! Thank you @bnasslahsen
Real issue is on the dependencies. For Spring Boot 3+ : Use the springdoc-openapi-starter-webmvc-ui dependency
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
<version>2.0.3</version>
</dependency>
For Spring Boot 2+: Use springdoc-openapi-ui dependency:
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-ui</artifactId>
<version>1.6.15</version>
</dependency>
Remember to add these to your application.yml
springdoc:
api-docs:
path: /v3/api-docs
swagger-ui:
path: /swagger-ui.html
enable: true
show-actuator: true
packages-to-scan: com.mycompany.service.controller
I still have this problem with:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.3.2</version>
</parent>
......
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
<version>2.6.0</version>
</dependency>
Java 17 on Windows 10. /v3/api-docs endpoint works, but the /swagger-ui/ doesn't.
https://github.com/springdoc/springdoc-openapi/issues/2528#issuecomment-2154283503 + adding <useJakartaEe>true</useJakartaEe>
to each configuration of openapi-generator-maven-plugin
solved the problem for me.
for spring boot 3 use 2.1.0
that solve my problem, 2.6.0 or anyone else return error "No static resource..."
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
<version>2.1.0</version>
</dependency>
In my case, it didn't work with springdoc-openapi-starter-webmvc-ui 2.0.3, 2.1.0 and 2.6.0, but it did work with 2.2.0 -- I'm running Ubuntu 24.04, JDK 21 and
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.3.4</version>
<relativePath/>
</parent>
In my case, it doesn't work with springdoc-openapi-starter-webmvc-ui 2.0.2, 2.1.0, 2.4.0 and 2.6.0 I'm using spring-security with csrf activated spring-boot-starter-parent 3.3.3 Windows11, JDK 17
Path /app/swagger-ui/index.html Error Not Found Status 404 Message No static resource swagger-ui/index.html.
application.properties springdoc.swagger-ui.csrf.enabled=true springdoc.swagger-ui.enabled=true springdoc.swagger-ui.path=/swagger-ui.html
Describe the bug
On our project, when upgrading from springdoc 2.3.0 to 2.4.0, access to swagger becomes broken. Using URL http://localhost:8080/swagger-ui/index.html :
Stack trace :
To Reproduce Steps to reproduce the behavior:
Expected behavior
Additional context It may be related to problems on swagger-ui 5.11.8 (issue) but the description of the problem is different.