Parameter 0 of method linkDiscoverers in org.springframework.hateoas.config.HateoasConfiguration req

tech2024-08-12  46

今天springboot整合swagger2出现了这个错误,感到无从下手,经过一番查询才了解到可能是版本不对,自己的springboot版本为2.3.3而swagger的版本是2.2.2版本太低了,不对付。

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]

更改swagger2的依赖版本后完美解决。

版本更改为2.9.2,解决

最新回复(0)