springboot整合swagger3踩坑

2022/1/19 6:06:28

本文主要是介绍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

转载记录一下



这篇关于springboot整合swagger3踩坑的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程