微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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

如果你是小白,这套资料可以帮你成为大牛,如果你有丰富开发经验,这套资料可以帮你突破瓶颈
2022web全套视频教程前端架构 H5 vue node 小程序 视频+资料+代码+面试题.

原因: 这是因为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

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐