diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/RepositorySearchesResource.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/RepositorySearchesResource.java index ad33a0f7c..0c352a49b 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/RepositorySearchesResource.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/RepositorySearchesResource.java @@ -19,6 +19,8 @@ import org.springframework.hateoas.ResourceProcessor; import org.springframework.hateoas.ResourceSupport; import org.springframework.util.Assert; +import com.fasterxml.jackson.annotation.JsonIgnore; + /** * A custom {@link ResourceSupport} type to be able to write custom {@link ResourceProcessor}s to add additional links * to ones automatically exposed for Spring Data repository query methods. @@ -45,6 +47,7 @@ public class RepositorySearchesResource extends ResourceSupport { * * @return */ + @JsonIgnore public Class getDomainType() { return domainType; } diff --git a/spring-data-rest-webmvc/src/test/java/org/springframework/data/rest/webmvc/CommonWebTests.java b/spring-data-rest-webmvc/src/test/java/org/springframework/data/rest/webmvc/CommonWebTests.java index 7ecf83a29..0cf6dfe5f 100644 --- a/spring-data-rest-webmvc/src/test/java/org/springframework/data/rest/webmvc/CommonWebTests.java +++ b/spring-data-rest-webmvc/src/test/java/org/springframework/data/rest/webmvc/CommonWebTests.java @@ -119,7 +119,9 @@ public abstract class CommonWebTests extends AbstractWebIntegrationTests { Link searchLink = client.getDiscoverer(response).findLinkWithRel("search", rootResourceRepresentation); if (searchLink != null) { - client.follow(searchLink).andExpect(client.hasLinkWithRel("self")); + client.follow(searchLink).// + andExpect(client.hasLinkWithRel("self")).// + andExpect(jsonPath("$.domainType", is(nullValue()))); // DATAREST-549 } } }