Skip to content

objectMapper.treeToValue is error-prone, should be either deprecated or fixed (or removed?) #496

@Fuud

Description

@Fuud

Use case
There is old issue: #45

Main problem: ObjectMapper.treeToValue looks very similar to ObjectMapper.readValue but suffers from type erasure.
It is very simple to missuse it.
Current behaviour is because ObjectMapper.treeToValue(TreeNode, TypeReference) does not exist.
As suggested in FasterXML/jackson-databind#1294 we can use readValue or convertValue.

Describe the solution you'd like
Let's either:

  1. reimplement ObjectMapper.treeToValue in type-safe way
  2. deprecate it with descriptive message

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions