spring-projects / spring-projects/spring-data-rest
Jackson's @JsonTypeInfo does not serialize correctly when used with As.PROPERTY, As.WRAPPER_OBJECT, or As.WRAPPER_ARRAY [DATAREST-900]
@odrotbohm is already working on this.
Since Dec 31, 2020.
- Dominant language
- Java
- Stars
- 958
- Forks
- 568
- PR merge metrics
- No merged PRs in 30d
Description
Alex Leigh opened DATAREST-900 and commented
This is a followup to DATAREST-872. Following the fix to that issue, @JsonTypeInfo now works when used with include = JsonTypeInfo.As.EXISTING_PROPERTY. However, for the other three possible values of include, i.e. PROPERTY, WRAPPER_OBJECT, and WRAPPER_ARRAY, the serialized value is not as expected. This is because both the PersistentEntityResourceSerializer and the NestedEntitySerializer are ignoring Jackson's TypeSerializer, so additional type metadata that Jackson normally writes when using @JsonTypeInfo with those three include values are not being written
Affects: 2.5.3 (Hopper SR3)
6 votes, 6 watchers
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.