springboot整合swagger3踩坑

出现错误:Failed to start bean 'documentationPluginsBootstrapper'; nested exception is java.lang.NullPointerException

参考:CSDN博主「shl一直在路上」 https://blog.csdn.net/shl1285067785/article/details/121933879

 

原因: 这是因为Springfox使用的路径匹配是基于AntPathMatcher的,而Spring Boot 2.6.X使用的是PathPatternMatcher。
解决:在application.properties里配置:spring.mvc.pathmatch.matching-strategy=ANT_PATH_MATCHER

转载记录一下

posted @ 2022-01-19 00:44  AlexFung  阅读(362)  评论(0)    收藏  举报