CopyPastor

Detecting plagiarism made easy.

Score: 1; Reported for: Exact paragraph match Open both answers

Possible Plagiarism

Plagiarized on 2020-08-29
by Oscar

Original Post

Original - Posted on 2020-06-18
by Mdelm



            
Present in both answers; Present only in the new answer; Present only in the old answer;

I am using springdoc-openapi and after having encountered this problem similar to the one mentioned here: ``` Description:
Parameter 0 of method linkDiscoverers in org.springframework.hateoas.config.HateoasConfiguration required a single bean, but 3 were found: - 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 ```
I configured my Swagger file like this ``` @Configuration @EnableHypermediaSupport(type=EnableHypermediaSupport.HypermediaType.HAL) public class OpenApiConfig {
// ... others beans
@Bean public LinkDiscoverers discoverers() { List<LinkDiscoverer> plugins = new ArrayList<>(); plugins.add(new CollectionJsonLinkDiscoverer()); return new LinkDiscoverers(SimplePluginRegistry.create(plugins)); } } ``` hope that this can't help someone
You can change your configuration class by adding the following bean ``` @Bean public LinkDiscoverers discoverers() { List<LinkDiscoverer> plugins = new ArrayList<>(); plugins.add(new CollectionJsonLinkDiscoverer()); return new LinkDiscoverers(SimplePluginRegistry.create(plugins)); } ``` the configuration class looks like this: ``` @Configuration @EnableSwagger2 public class SwaggerConfig {
@Bean public Docket api() { return new Docket(DocumentationType.SWAGGER_2); }
@Bean public LinkDiscoverers discoverers() { List<LinkDiscoverer> plugins = new ArrayList<>(); plugins.add(new CollectionJsonLinkDiscoverer()); return new LinkDiscoverers(SimplePluginRegistry.create(plugins)); } } ```

        
Present in both answers; Present only in the new answer; Present only in the old answer;