集成Swagger 2错误处理

SpringBoot 版本 2.5.2
Swagger 版本 2.2.2

错误:

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. 
2021-07-23 10:17:21 [main] ERROR o.s.b.diagnostics.LoggingFailureAnalysisReporter - 

***************************
APPLICATION FAILED TO START
***************************

Description:

Parameter 0 of method linkDiscoverers in org.springframework.hateoas.config.HateoasConfiguration required a single bean, but 15 were found:
    - modelBuilderPluginRegistry: defined in null
    - modelPropertyBuilderPluginRegistry: defined in null
    - typeNameProviderPluginRegistry: defined in null
    - documentationPluginRegistry: defined in null
    - apiListingBuilderPluginRegistry: defined in null
    - operationBuilderPluginRegistry: defined in null
    - parameterBuilderPluginRegistry: defined in null
    - expandedParameterBuilderPluginRegistry: defined in null
    - resourceGroupingStrategyRegistry: defined in null
    - operationModelsProviderPluginRegistry: defined in null
    - defaultsProviderPluginRegistry: defined in null
    - pathDecoratorRegistry: defined in null
    - relProviderPluginRegistry: defined by method 'relProviderPluginRegistry' in class path resource [org/springframework/hateoas/config/HateoasConfiguration.class]
    - linkDiscovererRegistry: defined in null
    - entityLinksPluginRegistry: defined by method 'entityLinksPluginRegistry' in class path resource [org/springframework/hateoas/config/WebMvcEntityLinksConfiguration.class]


Action:

Consider marking one of the beans as @Primary, updating the consumer to accept multiple beans, or using @Qualifier to identify the bean that should be consumed

这是由于Swagger和SpringBoot版本冲突导致的,直接将Swagger版本改成 2.9.2即可


不会炒股的程序员不是好程序员,加Q一起做韭菜吧:1249943558

你可能感兴趣的:(集成Swagger 2错误处理)