springboot整合swagger2项目启动报错解决

233 阅读1分钟

image.png

解决方法:在项目yml配置文件下添加mvc配置信息

spring:
  mvc:
    pathmatch:
      matching-strategy: ANT_PATH_MATCHER
      

原因: 版本不一致,这是因为Springfox使用的路径匹配是基于AntPathMatcher的,而Spring Boot 2.6.X使用的是PathPatternMatcher。