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

Patch with object value omitted [DATAREST-885] #1255

Closed
spring-projects-issues opened this issue Sep 6, 2016 · 0 comments
Closed

Patch with object value omitted [DATAREST-885] #1255

spring-projects-issues opened this issue Sep 6, 2016 · 0 comments
Assignees
Labels
type: bug A general bug

Comments

@spring-projects-issues
Copy link

Mathias D opened DATAREST-885 and commented

After migrating to spring data rest 2.5.2 the PATCH operation with application/json-patch+json for object values is broken.

Consider the following entity:

@Entity
public class Product implements Identifiable<Long> {

    @Id
    @GeneratedValue(strategy = IDENTITY)
    private Long id;

    private String name;

    @Embedded
    private Gtin gtin;
}

@Embeddable
@Getter
@Setter
public class Gtin {

    private String type;
    private String value;
}

I try to patch with the following payload.

[
  {
    "op":"replace",
    "path":"/gtin",
    "value":{"type":"EAN","value":"some"}
  }
]

As a result of this operation the property to update (gtin) is null.

org.springframework.data.rest.webmvc.json.patch.JsonLateObjectEvaluator#evaluate returns null because it receives a JsonMappingException as it tries to serialize the value json into the entity type.

Please see this product to reproduce the issue https://github.com/mduesterhoeft/spring-data-rest-json-patch-issue


Affects: 2.5.2 (Hopper SR2)

Reference URL: https://github.com/mduesterhoeft/spring-data-rest-json-patch-issue

Referenced from: pull request #223

Backported to: 2.5.3 (Hopper SR3)

1 votes, 1 watchers

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

No branches or pull requests

2 participants