[Solved] Springboot integrate swagger error: Failed to start bean ‘documentationPluginsBootstrapper‘

spring boot upgrade to 2.6.x+ version, I suddenly found the following error when integrating with swagger:

org.springframework.context.ApplicationContextException: Failed to start bean 'documentationPluginsBootstrapper'; nested exception is java.lang.NullPointerException

Reason: because the path matching used by springfox is based on AntPathMatcher, and spring boot 2.6.X uses PathPatternMatcher, which can change the matching rules

Solution:
add the following configuration in the configuration file (application.yaml)

spring:
  mvc:
    pathmatch:
      matching-strategy: ant_path_matcher

Read More: