Why HATEOAS starts creating issue for spring-boot version >= 2.2.x during startup with Swagger 2.x?

前端 未结 14 2231
忘掉有多难
忘掉有多难 2020-12-09 15:18

I moved my project from spring-boot 2.1.9 to 2.2.0.

While starting the project, I am facing the below error messages.

Caused by: org.sprin         


        
14条回答
  •  一向
    一向 (楼主)
    2020-12-09 15:59

    This kind of issue is occurring due to a new feature of Hateoas.

    If you want to solve this problem , just embed the following line of codes in your swagger configuration file.

    @Primary
    @Bean
    public LinkDiscoverers discoverers() {
        List plugins = new ArrayList<>();
        plugins.add(new CollectionJsonLinkDiscoverer());
        return new LinkDiscoverers(SimplePluginRegistry.create(plugins));
    }
    

    I think this is gonna solve your problem as it solved mine.

提交回复
热议问题