Spring boot 3 doesn't work with springfox 3.0
Asked Answered
A

2

2

I've been trying to integrate swagger with spring boot. I used spring boot version 3.0.4 with springfox 3.0

Here's my pom.xml file springfox dependency and parent

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>3.0.4</version>
    <relativePath/> <!-- lookup parent from repository -->
</parent>

<dependency>
    <groupId>io.springfox</groupId>
    <artifactId>springfox-boot-starter</artifactId>
    <version>3.0.0</version>
</dependency>

SpringfoxConfig.java


@Configuration
public class SpringFoxConfig {
    @Bean
    public Docket api() {
        return new Docket(DocumentationType.SWAGGER_2)
                .select()
                .apis(RequestHandlerSelectors.any())
                .paths(PathSelectors.any())
                .build();
    }
}

When I run the application and tried the url http://localhost:8080/swagger-ui/ I can't see the swagger ui instead I'm seeing white label error.

I migrated spring-parent to 2.7.9 and enabled the swagger with @EnableSwagger. I can see the swagger now.

I've used the reference document from springfox. Not sure, what's the issue with new version and how can be rectified.

Administration answered 5/3, 2023 at 11:1 Comment(1)
Does this answer your question? Spring Boot 2.6.0 / Spring fox 3 - Failed to start bean 'documentationPluginsBootstrapper'Gaultiero
I
4

I am sorry that as of today , springfox does not support Spring Boot 3 yet.(see this and this).

You can consider to use another similar project called springdoc which supports Spring Boot 3 and here is the migration guideline for migrating springfox to springdoc

Interjacent answered 5/3, 2023 at 11:20 Comment(2)
update migration guideGaultiero
Is this issue still open?Catechetical
A
0

springfox-boot-starter latest update at 2020, please replace with springdoc-openapi-starter-webmvc-ui, swagger-ui: /swagger-ui/index.html

    <dependency>
        <groupId>org.springdoc</groupId>
        <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
        <version>2.3.0</version>
    </dependency>
Adolfo answered 19/1, 2024 at 9:45 Comment(2)
springdoc guidesAdolfo
It is always good to share the sources you've checked. In this case it is important to leave in the response you've given, the resources you've read where it becomes clear that a migration from springfox to springdoc-openapi is necessary (i.e. links, books, github, etc)Autotoxin

© 2022 - 2025 — McMap. All rights reserved.