Issue
When I access my Spring Boot Application at http://localhost:8080/
I always receive following JSON. I have no idea where this JSON comes from and I don't think I made a controller for this. Have you maybe seen something like this before? Does it have something to do with Swagger?
p.s. I'm using spring MVC and spring Security in my application.
This is my build.gradle file:
dependencies {
// Spring Boot
//implementation "org.springframework.boot:spring-boot-starter-web:${springBootVersion}"
implementation "org.springframework.boot:spring-boot-starter-data-rest:${springBootVersion}"
implementation "org.springframework.boot:spring-boot-starter-data-jpa"
implementation "org.springframework.boot:spring-boot-configuration-processor"
implementation "org.springframework.boot:spring-boot-starter-security"
// Spring Cloud
implementation "org.springframework.cloud:spring-cloud-starter-config"
implementation "org.springframework.cloud:spring-cloud-starter-netflix-eureka-client"
implementation group: 'org.springframework.cloud', name: 'spring-cloud-config-client', version: "${springBootVersion}"
implementation group: 'org.springframework.cloud', name: 'spring-cloud-starter-openfeign'
implementation group: 'org.springframework.cloud', name: 'spring-cloud-starter-netflix-hystrix'
compileOnly group: 'org.springframework.boot', name: 'spring-boot-configuration-processor'
}
Solution
This response is provided by Spring Data REST (which you have included by using the spring-boot-starter-data-rest dependency).
Excerpt from the official documentation:
Resource discovery starts at the top level of the application. By issuing a request to the root URL under which the Spring Data REST application is deployed, the client can extract, from the returned JSON object, a set of links that represent the next level of resources that are available to the client.
Answered By - dunni
Answer Checked By - Senaida (JavaFixing Volunteer)