diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/RepositoryRestController.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/RepositoryRestController.java index fb97e6ba2..8f326d06a 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/RepositoryRestController.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/RepositoryRestController.java @@ -732,9 +732,9 @@ public class RepositoryRestController selfUri); resource.addLink(new SimpleLink(SELF, selfUri)); - publishEvent(new BeforeRenderResourceEvent(request, repoMeta, body)); - body = resource; + + publishEvent(new BeforeRenderResourceEvent(request, repoMeta, body)); } return negotiateResponse(request, HttpStatus.CREATED, headers, body); @@ -885,9 +885,9 @@ public class RepositoryRestController selfUri); res.addLink(new SimpleLink(SELF, selfUri)); - publishEvent(new BeforeRenderResourceEvent(request, repoMeta, body)); - body = res; + + publishEvent(new BeforeRenderResourceEvent(request, repoMeta, body)); } if(!isUpdate) { diff --git a/spring-data-rest-webmvc/src/test/groovy/org/springframework/data/rest/webmvc/spec/DiscoverySpec.groovy b/spring-data-rest-webmvc/src/test/groovy/org/springframework/data/rest/webmvc/spec/DiscoverySpec.groovy index 6e19626a1..1574f0578 100644 --- a/spring-data-rest-webmvc/src/test/groovy/org/springframework/data/rest/webmvc/spec/DiscoverySpec.groovy +++ b/spring-data-rest-webmvc/src/test/groovy/org/springframework/data/rest/webmvc/spec/DiscoverySpec.groovy @@ -25,7 +25,7 @@ class DiscoverySpec extends BaseSpec { def links = readJson(response).links then: - links.size() == 4 + links.size() == 5 }