这个问题的原因在于spring boot 2.6.x以后的版本中,匹配策略改变了,与SpringFox策略不一样了。Springfox使用的路径匹配是基于AntPathMatcher的,而Spring Boot 2.6.X使用的是PathPatternMatcher。
解决方案
spring.mvc.pathmatch.matching-strategy=ANT_PATH_MATCHER
这个问题的原因在于spring boot 2.6.x以后的版本中,匹配策略改变了,与SpringFox策略不一样了。Springfox使用的路径匹配是基于AntPathMatcher的,而Spring Boot 2.6.X使用的是PathPatternMatcher。
解决方案
spring.mvc.pathmatch.matching-strategy=ANT_PATH_MATCHER