Skip to content
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

Spring Data REST with Custom Resource URI Fails on PUT/PATCH [DATAREST-1224] #1583

Closed
spring-projects-issues opened this issue Apr 3, 2018 · 4 comments
Assignees
Labels
status: duplicate type: bug

Comments

@spring-projects-issues
Copy link

spring-projects-issues commented Apr 3, 2018

Christopher Marth opened DATAREST-1224 and commented

See the referenced StackOverflow question for details...


Affects: 3.0.5 (Kay SR5)

Reference URL: https://stackoverflow.com/questions/49620237/spring-data-rest-with-custom-resource-uri-fails-on-put-patch-spring-boot-2-0

Issue Links:

  • DATAREST-1304 PUT and PATCH don't work, when custom entity lookup is configured
    ("duplicates")

8 votes, 10 watchers

@spring-projects-issues
Copy link
Author

spring-projects-issues commented Apr 3, 2018

Oliver Drotbohm commented

Please make sure you copy the relevant information over to this ticket, potentially augmented with a sample project showing the problem. StackOverflow questions are fine but don't serve well as context for bug fixing as we control the lifecycle of the information on a third party website

@spring-projects-issues
Copy link
Author

spring-projects-issues commented Jul 11, 2018

benco03 commented

Using the 'spring-data-examples' repository, I have recreated this problem in an integration test. I've created a fork here:

https://github.com/benco03/spring-data-examples

Commit which added the example: benco03/spring-data-examples@9079c21

I have run into this issue while migrating a Spring Boot 1.5.8 application to Spring Boot 2.0.2.

This code will work using Spring Boot 1.5.8, but breaks in Spring Boot 2.0.2 onwards.

As far as I can tell:

  • PersistentEntityResourceHandlerMethodArgumentResolver:130 

  • idResolver.resolveArgument finds mapping of /{repository}/{id} for request of '/users/oliviergierke'

  • Returns 'oliviergierke' as ID

  • PersistentEntityResourceHandlerMethodArgumentResolver:149

    • tries to set 'oliviergierke' into the ID field identified by @Id
    • Entity has @Id annotation on UUID field
    • Tries to convert 'oliviergierke' to UUID and throws an exception

 

@spring-projects-issues
Copy link
Author

spring-projects-issues commented May 14, 2019

Sebastian Ullrich commented

Seems to be fixed with Spring Data REST 2.2.0 M2

@spring-projects-issues
Copy link
Author

spring-projects-issues commented Jun 27, 2019

Oliver Drotbohm commented

This seems to duplicate DATAREST-1304 and thus be fixed with the fix for that. Please give the latest milestones a try and report your findings. Resolving for now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: duplicate type: bug
Projects
None yet
Development

No branches or pull requests

2 participants