HateoasConfiguration required a single bean, but 17 were found

2045 ワード

エラーの長さ:
***************************
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));
 }

テキスト