Swagger not detecting Spring Data Rest APIs with Spring Boot Swagger not detecting Spring Data Rest APIs with Spring Boot spring spring

Swagger not detecting Spring Data Rest APIs with Spring Boot


Upgrade to latest version of swagger

    <dependency>        <groupId>io.springfox</groupId>        <artifactId>springfox-swagger2</artifactId>        <version>2.7.0</version>    </dependency>    <dependency>        <groupId>io.springfox</groupId>        <artifactId>springfox-data-rest</artifactId>        <version>2.7.0</version>    </dependency>    <dependency>        <groupId>io.springfox</groupId>        <artifactId>springfox-swagger-ui</artifactId>        <version>2.7.0</version>    </dependency>

Additionally import spring data rest annotation on spring Configuration/Application class.

@Import(SpringDataRestConfiguration.class)


Spring Data Rest support was only introduced in springfox version 2.6.0. If you follow the instructions after upgrading to the latest version of springfox (2.6.1 at the time of this writing) you shouldn't have a problem with rendering the endpoints.


Did you import the configuration from springfox-data-rest? As Dilip Krishnan said, I followed the instructions and imported the configuration, adding this annotation to my Main Application class:

@Import({springfox.documentation.spring.data.rest.configuration.SpringDataRestConfiguration.class})

Hope it helps!