diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/config/RepositoryRestMvcConfiguration.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/config/RepositoryRestMvcConfiguration.java index 214334e10..10496025c 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/config/RepositoryRestMvcConfiguration.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/config/RepositoryRestMvcConfiguration.java @@ -15,6 +15,7 @@ */ package org.springframework.data.rest.webmvc.config; +import java.lang.reflect.Type; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; @@ -730,6 +731,16 @@ public class RepositoryRestMvcConfiguration extends HateoasAwareSpringDataWebCon this.order = order; } + /* + * (non-Javadoc) + * @see org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter#canRead(java.lang.reflect.Type, java.lang.Class, org.springframework.http.MediaType) + */ + @Override + public boolean canRead(Type type, Class contextClass, MediaType mediaType) { + return ResourceSupport.class.isAssignableFrom(getJavaType(type, contextClass).getRawClass()) + && super.canRead(type, contextClass, mediaType); + } + /* * (non-Javadoc) * @see org.springframework.core.Ordered#getOrder()