Skip to content

Add new method for ObjectReader, to bind from JSON Pointer position #820

@cowtowncoder

Description

@cowtowncoder

Reading a subset of a document, binding it, is quite possible to do already. For example by:

JsonNode tree = mapper.readTree(source);
JsonNode node = tree.at("/caller/1/name");
POJO value = mapper.treeToValue(node, POJO.class);

But it would be even more convenient (and, potentially, more efficient) to make ObjectReader find the JSON Pointer location using new (2.6) streaming filter, and bind directly from there.

Something like:

POJO value = mapper.reader(POJO.class)
    .at("/caller/1/name")
    .readValue(source);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions