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

Document that @JsonUnwrapped also applies to deserialization #184

Closed
mjustin opened this issue Feb 1, 2021 · 1 comment
Closed

Document that @JsonUnwrapped also applies to deserialization #184

mjustin opened this issue Feb 1, 2021 · 1 comment

Comments

@mjustin
Copy link

mjustin commented Feb 1, 2021

The Stack Overflow question What's the Jackson deserialization equivalent of @JsonUnwrapped? currently has 52 upvotes. It is therefore clear that users are surprised to find that @JsonUnwrapped also applies to deserialization.

A prime source of this confusion appears to be the fact that the documentation for @JsonUnwrapped does not mention deserialization at all:

Annotation used to indicate that a property should be serialized "unwrapped"

Other annotations that apply to both serialization & deserialization call this out in the documentation, including @JsonIgnoreProperties, @JsonIgnoreProperties, & @JsonView.

It seems therefore that it would be helpful if the Javadocs mentioned that the annotation applies to deserialization as well as serialization.

@cowtowncoder
Copy link
Member

Sounds reasonable: if anyone has time, PR (against branch 2.12, I think) would be very welcome.
Unfortunately javadocs mostly get updated when code changes, but in case of annotations code mostly changes in jackson-databind and annotations themselves are not modified, just their applicability.

@cowtowncoder cowtowncoder changed the title Document that @JsonUnwrapped also applies to deserialization Document that @JsonUnwrapped also applies to deserialization Feb 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants