From 45fb781d33da121bf155f15f1a3b2753688d0483 Mon Sep 17 00:00:00 2001 From: Brandon Vulaj Date: Sun, 31 Mar 2019 21:43:49 -0400 Subject: [PATCH 1/2] Fix for a bug around single link PUTs introduced in 554d6cb2 --- .../data/rest/webmvc/RepositoryPropertyReferenceController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/RepositoryPropertyReferenceController.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/RepositoryPropertyReferenceController.java index 3ecca5bde3..4d058961b8 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/RepositoryPropertyReferenceController.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/RepositoryPropertyReferenceController.java @@ -318,7 +318,7 @@ public ResponseEntity> createPropertyReference( "Cannot PATCH a reference to this singular property since the property type is not a List or a Map."); } - if (source.getLinks().hasSingleLink()) { + if (!source.getLinks().hasSingleLink()) { throw new IllegalArgumentException( "Must send only 1 link to update a property reference that isn't a List or a Map."); } From a26fe6992909f3c76b7872cb61ecc424f397471a Mon Sep 17 00:00:00 2001 From: Brandon Vulaj Date: Sun, 31 Mar 2019 21:57:20 -0400 Subject: [PATCH 2/2] DATAREST-1356 - Updated authors. --- .../data/rest/webmvc/RepositoryPropertyReferenceController.java | 1 + 1 file changed, 1 insertion(+) diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/RepositoryPropertyReferenceController.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/RepositoryPropertyReferenceController.java index 4d058961b8..a15c7b6bcc 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/RepositoryPropertyReferenceController.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/RepositoryPropertyReferenceController.java @@ -77,6 +77,7 @@ * @author Jon Brisbin * @author Oliver Gierke * @author Greg Turnquist + * @author Brandon Vulaj */ @RepositoryRestController @SuppressWarnings({ "unchecked" })