Failed to start bean ‘documentationPluginsBootstrapper’; nested exception is java.lang.NullPointerException
springboot 集成Swagger2报错
错误原因是:Springfox使用的路径匹配是基于AntPathMatcher的,而Spring Boot 2.6.X使用的是PathPatternMatcher。
解决办法:
方法一:springboot版本回退到2.5.X;
方法二:application.yml配置文件配置路径如下
spring:
mvc:
pathmatch:
matching-strategy: ANT_PATH_MATCHER