Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenAPI + Springboot - Swagger not available #2813

Open
LouisLa88 opened this issue Dec 13, 2024 · 5 comments
Open

OpenAPI + Springboot - Swagger not available #2813

LouisLa88 opened this issue Dec 13, 2024 · 5 comments

Comments

@LouisLa88
Copy link

LouisLa88 commented Dec 13, 2024

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>
@vianneynara
Copy link

vianneynara commented Dec 14, 2024

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.

image

@Tsyklop
Copy link

Tsyklop commented Dec 17, 2024

Same issue.

@hiabhi-cpu
Copy link

Try adding this dependency

org.springdoc
springdoc-openapi-starter-webmvc-ui
2.6.0

i got swagger integrated into it

@KabarbekN
Copy link

Same issue with spring boot 3.4.0 and openapi 2.7.0

@vianneynara
Copy link

vianneynara commented Dec 18, 2024

Try adding this dependency org.springdoc springdoc-openapi-starter-webmvc-ui 2.6.0

i got swagger integrated into it

@hiabhi-cpu

The OP has already shown that they have version 2.7.0 installed, downgrading it to 2.6.0 wouldn't solve the issue since Spring Boot 3.4.0 specifically requires springdoc to be 2.7.0. Let me know if I'm wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants