Skip to content

Unsafe, not typed result of treeToValue method. #45

Closed
@DmRomantsov

Description

@DmRomantsov

Sample code:
val listOfPojo:List<POJO> = jsonMapper.treeToValue(jsonNode)
Return List<LinkedHashMap> instead of List<POJO>. After iterration have java.lang.ClassCastException: java.util.LinkedHashMap cannot be cast to POJO.

Works OK:
val listOfPojo<POJO> = jsonMapper.readValue(jsonNode.toString())

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions