diff --git a/spring-boot-actuator/pom.xml b/spring-boot-actuator/pom.xml
index fffaee3a60..fd786e55f7 100644
--- a/spring-boot-actuator/pom.xml
+++ b/spring-boot-actuator/pom.xml
@@ -302,5 +302,10 @@
spring-data-elasticsearch
test
+
+ org.springframework.data
+ spring-data-rest-webmvc
+ test
+
diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/EndpointWebMvcChildContextConfiguration.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/EndpointWebMvcChildContextConfiguration.java
index 7e44e0dc2a..fc7c7a90d1 100644
--- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/EndpointWebMvcChildContextConfiguration.java
+++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/EndpointWebMvcChildContextConfiguration.java
@@ -41,6 +41,7 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingClass;
import org.springframework.boot.autoconfigure.condition.SearchStrategy;
+import org.springframework.boot.autoconfigure.hateoas.HypermediaHttpMessageConverterConfiguration;
import org.springframework.boot.autoconfigure.web.DispatcherServletAutoConfiguration;
import org.springframework.boot.autoconfigure.web.ErrorAttributes;
import org.springframework.boot.autoconfigure.web.ServerProperties;
@@ -53,6 +54,8 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.AnnotationAwareOrderComparator;
+import org.springframework.hateoas.LinkDiscoverer;
+import org.springframework.hateoas.config.EnableHypermediaSupport;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.web.servlet.DispatcherServlet;
@@ -69,6 +72,7 @@ import org.springframework.web.servlet.config.annotation.EnableWebMvc;
*
* @author Dave Syer
* @author Stephane Nicoll
+ * @author Andy Wilkinson
* @see EndpointWebMvcAutoConfiguration
*/
@Configuration
@@ -193,6 +197,14 @@ public class EndpointWebMvcChildContextConfiguration {
}
+ @Configuration
+ @ConditionalOnClass({ LinkDiscoverer.class })
+ @Import(HypermediaHttpMessageConverterConfiguration.class)
+ @EnableHypermediaSupport(type = EnableHypermediaSupport.HypermediaType.HAL)
+ static class HypermediaConfiguration {
+
+ }
+
static class ServerCustomization implements EmbeddedServletContainerCustomizer,
Ordered {
diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/EndpointWebMvcHypermediaManagementContextConfiguration.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/EndpointWebMvcHypermediaManagementContextConfiguration.java
index e0a9107aaf..18f694cece 100644
--- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/EndpointWebMvcHypermediaManagementContextConfiguration.java
+++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/EndpointWebMvcHypermediaManagementContextConfiguration.java
@@ -18,6 +18,7 @@ package org.springframework.boot.actuate.autoconfigure;
import java.io.IOException;
import java.lang.reflect.Type;
+import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
@@ -61,6 +62,7 @@ import org.springframework.http.server.ServletServerHttpRequest;
import org.springframework.util.TypeUtils;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.servlet.HandlerMapping;
+import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter;
import org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
@@ -219,7 +221,7 @@ public class EndpointWebMvcHypermediaManagementContextConfiguration {
public static class MvcEndpointAdvice implements ResponseBodyAdvice