0
点赞
收藏
分享

微信扫一扫

springboot集成swagger3出现如下错误:Failed to start bean ‘documentationPluginsBootstrapper‘; nested exception

笙烛 2022-02-20 阅读 78
前端html

原因: 这是因为Springfox使用的路径匹配是基于AntPathMatcher的,而Spring Boot 2.6.X使用的是PathPatternMatcher。

解决:在application.properties里配置:spring.mvc.pathmatch.matching-strategy=ANT_PATH_MATCHER

1.导入依赖

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

2.swagger配置类

@Configuration
@EnableOpenApi
public class SwaggerConfig {
}

3.访问:http://localhost:8080/swagger-ui/index.html

举报

相关推荐

0 条评论