[Solved] Failed to start bean ‘documentationPluginsBootstrapper‘; nested exception is java.lang.NullPointerEx

Description:

When using springboot to integrate swagger2config, an error is reported. The error information is as follows:

Analysis:

I am using Springboot 2.6.3, Spring Boot 2.6.X uses PathPatternMatcher to match paths, the path matching used by Springfox referenced by Swagger is based on AntPathMatcher, so it needs to be configured.

Solution:

Add the following configuration to the YML configuration file:

spring:
  mvc:
    pathmatch:
      matching-strategy: ANT_PATH_MATCHER

Read More: