Skip to content

[guava] Multimap deserializer does not honor DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY #6

Closed
@cowtowncoder

Description

@cowtowncoder

(moved from FasterXML/jackson-datatype-guava#89 by @neilmcguigan)

Should be able to have

enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY);
class Foo {
    public Multimap<String,String> bar;
}

with JSON

{
  bar: "qux"
}

However, this throws exception:

JsonMappingException: Expecting START_ARRAY, found VALUE_STRING`

Please note that this works:

class Foo {
    List<String> bar;
}

with JSON:

{
  bar: "qux"
}

when

enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions