错误长相:
***************************
APPLICATION FAILED TO START
***************************Description:Parameter 0 of method linkDiscoverers in org.springframework.hateoas.config.HateoasConfiguration required a single bean, but 17 were found:
...
此错误可现于 Swagger + HATEOAS 项目中。解决方法是添加 LinkDiscoverers 的 bean:
@Bean
public LinkDiscoverers discoverers() {
List<LinkDiscoverer> plugins = new ArrayList<>();plugins.add(new CollectionJsonLinkDiscoverer());return new LinkDiscoverers(SimplePluginRegistry.create(plugins));}
原文