You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When defining a Guava ImmutableList on org.immutables.value.Value.Immutable objects to correctly deserialize both from a single JSON object and also from an array with the ACCEPT_SINGLE_VALUE_AS_ARRAY annotation on the field it fails to do so.
In case of using a java.util.List instead of the Guava type it works. Not sure if issue is within Jackson itself or somewhere else, please advise.
Version information
2.14
To Reproduce
To reproduce I created an Immutable type with a single list field which should accept both a single object and an array as a JSON input (set with ACCEPT_SINGLE_VALUE_AS_ARRAY).
com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize value of type `com.google.common.collect.ImmutableList<java.lang.Object>` from Object value (token `JsonToken.START_OBJECT`)
at [Source: (String)"{ "lines":
{
"data": "something"
} }"; line: 2, column: 12] (through reference chain: com.picnic.supplierinterface.edeka.reddi.api.model.Example$Json["lines"])
while the same thing but with a java.util.List type:
Ok, I strongly suspect this is not something Jackson handles, but things do get hairy with combinations of so many pieces.
One thing that might help would be to first see if direct use of ImmutableList (from Guava) would work, without Immutables framework. If not, it's likely Guava module's problem (and if so, should move/file issue there).
Describe the bug
When defining a Guava
ImmutableList
onorg.immutables.value.Value.Immutable
objects to correctly deserialize both from a single JSON object and also from an array with theACCEPT_SINGLE_VALUE_AS_ARRAY
annotation on the field it fails to do so.In case of using a
java.util.List
instead of the Guava type it works. Not sure if issue is within Jackson itself or somewhere else, please advise.Version information
2.14
To Reproduce
To reproduce I created an Immutable type with a single list field which should accept both a single object and an array as a JSON input (set with
ACCEPT_SINGLE_VALUE_AS_ARRAY
).throws
while the same thing but with a
java.util.List
type:deserializes correctly and prints:
The text was updated successfully, but these errors were encountered: