Skip to content

GuavaImmutableCollectionDeserializer cannot deserialize an empty Optional from null #53

@jonfreedman

Description

@jonfreedman

The following test should pass

public void testImmutableListOfOptionals() throws IOException {
	ImmutableList<OptionalInt> list = MAPPER.readValue("[1,null,3]", new TypeReference<ImmutableList<OptionalInt>>() { });
	assertEquals(3, list.size());
	assertEquals(OptionalInt.of(1), list.get(0));
	assertEquals(OptionalInt.empty(), list.get(1));
	assertEquals(OptionalInt.of(3), list.get(2));
}

See #27

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions