Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit f83b221

Browse files
Fix updating single associations
There is an bug introduced a few months ago. This commit should fix it. I will try to find come time and write test. Please let me know, if it seems to be bug also to you. PS: According git history, there was (prior some rebase) condition like `getLinks().size() != 1`.
1 parent a376634 commit f83b221

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/RepositoryPropertyReferenceController.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ public ResponseEntity<? extends RepresentationModel<?>> createPropertyReference(
318318
"Cannot PATCH a reference to this singular property since the property type is not a List or a Map.");
319319
}
320320

321-
if (source.getLinks().hasSingleLink()) {
321+
if (!source.getLinks().hasSingleLink()) {
322322
throw new IllegalArgumentException(
323323
"Must send only 1 link to update a property reference that isn't a List or a Map.");
324324
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /