Skip to content

readerForUpdating(objectToUpdate).readValue(json) behaves unexpectedly on Optional<List> #214

@jc84-dev

Description

@jc84-dev

assume we have


class A {
//@JsonMerge  --> if this is added here, it will throw exception in the runtime
public Optional<List<String>> list = Optional.empty();
}

A obj = objectMapper.readValue("{list:['a']", A.class)   --> obj.list = ["a"] as expected
readerForUpdating(obj).readValue({list:['b'])    --> obj.list = ["b"]  which is not as expected.  I expected obj.list = ["a", "b"] here 

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