-
Couldn't load subscription status.
- Fork 563
DATAREST-1356 Fix updating single associations (second pull req for same isue) #364
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
lareferencia
commented
Oct 10, 2019
Yes, I found this bug and commented on original "fix". I have tested and this is the right solution.
bvulaj
commented
Oct 10, 2019
This is a duplicate of #354
f83b221 to
a94e839
Compare
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`.
Simple test of single link association and its rewrite through PUT.
a94e839 to
b3273ac
Compare
Check that server does refuce to put two Person links to Orders creator association link. Expected result is 5XX status code (ServerError) with message containing substring "send only 1 link".
Must send only 1 link to update a property reference that isn't a List or a Map
what a dirty mistake!
the bug is in spring boot 2.2.0.RELEASE, will it be fixed in 2.2.1.RELEASE?
I had to revert our products to older version :-( ruined my weekends
Thanks @luvarqpp!
Since your PR had the most testing, I went ahead and took it, polished it (slightly), and backported it to 3.2.x branch.
To use fixed version right now, I am using temporary snapshot build of artifact. Maven pom snippet:
<?xml version="1.0" encoding="UTF-8"?> <project> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.2.0.RELEASE</version> <relativePath/> <!-- lookup parent from repository --> </parent> <!-- https://spring-calendar.cfapps.io/ --> <dependencies> <dependency> <!-- TODO temporary to fix single link association... https://github.com/spring-projects/spring-data-rest/pull/364 --> <groupId>org.springframework.data</groupId> <artifactId>spring-data-rest-webmvc</artifactId> <version>3.3.0.BUILD-SNAPSHOT</version> </dependency> </dependencies> <repositories> <repository> <id>spring-snapshot</id> <name>Spring Snapshot Repository</name> <url>https://repo.spring.io/snapshot</url> </repository> <repository> <id>spring-milestones</id> <name>Spring Milestones</name> <url>https://repo.spring.io/milestone</url> </repository> </repositories> </project>
Uh oh!
There was an error while loading. Please reload this page.
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.