Using Spring Boot 1.4.0, Spring Data REST no longer seems to take the @JsonUnwrapped annotation into account to unwrap entities in the JSON responses. The previous Spring Boot versions (i.c. 1.3.7) does not have this problem.
It can be easily reproduced on the master branch of the RestBucks project. When you PUT a payment for an order, the credit card number should be unwrapped, since it is annotated with @JsonUnwrapped, but it is not:
This looks like a Spring Data REST bug. Spring Boot 1.3.x uses Spring Data Gosling and @JsonUnwrapped works as expected. However if spring-data-releasetrain.version is overriden to use Spring Data Hopper @JsonUnwrapped no longer works. You can see this behaviour if you check out and run this commit in RestBucks
Pablo Santiago opened DATAREST-880 and commented
Using Spring Boot 1.4.0, Spring Data REST no longer seems to take the
@JsonUnwrapped
annotation into account to unwrap entities in the JSON responses. The previous Spring Boot versions (i.c. 1.3.7) does not have this problem.It can be easily reproduced on the master branch of the RestBucks project. When you PUT a payment for an order, the credit card number should be unwrapped, since it is annotated with
@JsonUnwrapped
, but it is not:The expected output would be (if the
@JsonUnwrapped
annotation was parsed correctly):This looks like a Spring Data REST bug. Spring Boot 1.3.x uses Spring Data Gosling and
@JsonUnwrapped
works as expected. However ifspring-data-releasetrain.version
is overriden to use Spring Data Hopper@JsonUnwrapped
no longer works. You can see this behaviour if you check out and run this commit in RestBucksAffects: 2.5.2 (Hopper SR2)
Reference URL: spring-projects/spring-boot#6722
Referenced from: commits 4cb0632, 7ab5efc
Backported to: 2.5.3 (Hopper SR3)
1 votes, 4 watchers
The text was updated successfully, but these errors were encountered: