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

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

Closed
luvarqpp wants to merge 3 commits into spring-projects:master from luvarqpp:patch-1

Conversation

@luvarqpp
Copy link
Contributor

@luvarqpp luvarqpp commented Oct 3, 2019
edited
Loading

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.

  • You have read the Spring Data contribution guidelines.
  • There is a ticket in the bug tracker for the project in our JIRA.
  • You use the code formatters provided here and have them applied to your changes. Don’t submit any formatting related changes.
  • You submit test cases (unit or integration tests) that back your changes.
  • You added yourself as author in the headers of the classes you touched. Amend the date range in the Apache license header if needed. For new types, add the license header (copy from another file and set the current year only).

Copy link

Yes, I found this bug and commented on original "fix". I have tested and this is the right solution.

Copy link

bvulaj commented Oct 10, 2019

This is a duplicate of #354

@luvarqpp luvarqpp changed the title (削除) Fix updating single associations (削除ここまで) (追記) DATAREST-1356 Fix updating single associations (second pull req for same isue) (追記ここまで) Oct 11, 2019
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.
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".
@luvarqpp luvarqpp marked this pull request as ready for review October 15, 2019 07:28
Copy link

lqforgithub commented Oct 19, 2019
edited
Loading

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

Copy link
Contributor

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.

Copy link
Contributor

Resolved via 202a8aa. Backported to 3.2.x via 87f9904.

Thanks to everyone for working hard to bring this one home.

The solution is in both master branch (Neumann) as well as 3.2.x (Moore SR1).

Copy link
Contributor Author

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>
lqforgithub reacted with thumbs up emoji

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

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