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

spring boot 3.0.x swagger doesn't work #4049

Closed
MBasdas opened this issue Jan 19, 2023 · 1 comment
Closed

spring boot 3.0.x swagger doesn't work #4049

MBasdas opened this issue Jan 19, 2023 · 1 comment

Comments

@MBasdas
Copy link

MBasdas commented Jan 19, 2023

Hi I am using spring boot 3.0.x latest version and Java 17.

When I add this dependencies on the 2.7.x spring boot project its work fine without any configuration..

But when I use this dependencies on the 3.0.x spring boot version it doesn't work.

org.springdoc springdoc-openapi-ui 1.6.14 , io.springfox springfox-swagger-ui 3.0.0 , io.springfox springfox-boot-starter 3.0.0

I made a configuration like this;

@EnableSwagger2
@configuration
public class SwaggerConfig {

@Bean
public Docket api() {
    return new Docket(DocumentationType.SWAGGER_2)
            .select()
            .apis(RequestHandlerSelectors.basePackage("com.example.demo"))
            .paths(PathSelectors.any())
            .build();
}

}

When I use this configuration the project doesn't start because of @EnableSwagger2 and I need to add this dependency on the project

javax.servlet javax.servlet-api 4.0.1 provided

After this dependency the project is starting but I can't reach to

localhost:8080/swagger-ui.html
localhost:8080/swagger-ui/
localhost:8080/swagger-ui/index.html
localhost:8080/swagger-ui/swagger-ui.html

All of them show me Whitelabel page.

My restful apis are work fine.

Why I cant use swagger without configuration on spring boot 3.0.x ?
Or if i need to make any configuration what is it?

@strazdinsg
Copy link

Duplicate of #3983

@MBasdas MBasdas closed this as completed Jan 30, 2023
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

2 participants