-
-
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
Java 8 Optional
not working with @JsonUnwrapped
on unwrappable type
#2565
Comments
Thank you for reporting this. I'll have to see what might be the correct behavior, given constraints; that is, whether it is possible to reliable support combination of |
Optional
not working with @JsonUnwrapped
on unwrappable type
Ok, so I was able to resolve the issue as reported (used Was also wondering if this case should instead throw an exception (use of |
I prefer to keep the current behavior. It is useful when I do not know the exact type of the field to be unwrapped. For example: class TimestampedValue<T> {
@JsonProperty("_timestamp") long timestamp;
@JsonUnwrapped T value;
} I prefer to unwrap the |
Ok. Since it has not been blocked before, it seems reasonable to keep it that way even if this specific style of usage is not something I thought as original use case. |
jackson-databind/src/main/java/com/fasterxml/jackson/databind/ser/std/ReferenceTypeSerializer.java
Line 300 in f315f1b
I think change the expression to
may fix it, but
_valueSerializer
can be null here. Hoping anyone familiar with this can fix it.The text was updated successfully, but these errors were encountered: