-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
@JsonValue
not considered when evaluating inclusion
#2909
Comments
Interesting. Fixing this might be as simple (?) as adding functional |
Actually, while the basic idea is to indeed implement |
@JsonValue
not considered when evaluating inclusion
Thanks! Should I plan to bump to 2.12.0 when it's out to see the new output? |
I am planning to release one more rc, 2.12.0-rc2 within 1 week. |
Seems not to work on my side. I'm using 2.12.3 and the @JsonValue annotated getter is still serialized to "null"/default-value if I set JsonInclude to My POJO looks like this:
Any ideas @cowtowncoder ? |
@mbenz89 This is a bit different combination than issue here and is not supported. Technical reason is because |
@cowtowncoder I see. Thanks a lot for the elaboration! |
I have an object (a
links
holder) that is essentially a container around ajava.util.Map
. The map is annotated with@JsonValue
, and this behaves as expected (the map is dumped as a JSON object inline).However, I only want this included when the map is non-empty, so I annotated the
getLinks()
method with@JsonInclude(NON_EMPTY)
. However, it appears that the inclusion filter is applied before the value substitution, so it is always included even as{}
.I'm using Jackson 2.11.2 (managed via Spring Boot).
The text was updated successfully, but these errors were encountered: