springdoc-openapi: OpenAPI + Springboot - Swagger not available
Describe the bug
the api-doc endpoint is available, but swagger is not accessible with springboot 3.4.0 and springdoc 2.7.0
To Reproduce Steps to reproduce the behavior:
- What version of spring-boot you are using? 3.4.0
- What modules and versions of springdoc-openapi are you using? 2.7.0
- What is the actual and the expected result using OpenAPI Description (yml or json)?
- Provide with a sample code (HelloController) or Test that reproduces the problem
Expected behavior
Be able to use swagger-ui.html
Screenshots If applicable, add screenshots to help explain your problem.
Additional context Add any other context about the problem here.
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.examples</groupId>
<artifactId>rest-controller-openapi</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<properties>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>3.4.0</version>
</dependency>
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
<version>2.7.0</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.34</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
<version>3.4.0</version>
</dependency>
</dependencies>
<build>
<finalName>rest-controller-openapi</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 4
- Comments: 16
Yes, it works:
I’m using spring “3.4.1” and works, see:
properties:
@socmia, I tried on springboot
3.4.1and downgrade springdoc to2.7.0-RC1, able to run as well.Bumping this, I am having the same issue right after updating Spring Boot 3.4.0 from 3.3.4, and having to upgrade springdoc to 2.7.0. Looking from
/actuator/mappings, the swagger endpoint seems unavailable.same issue, spring boot 3.4.0 and openapi 2.0.2
same issue, spring boot 3.4.0
@hiabhi-cpu
The OP has already shown that they have version
2.7.0installed, downgrading it to2.6.0wouldn’t solve the issue since Spring Boot 3.4.0 specifically requires springdoc to be2.7.0. Let me know if I’m wrong.Same issue with spring boot 3.4.0 and openapi 2.7.0