Skip to content

TreeTraversingParser and UTF8StreamJsonParser create contexts differently #2049

@apetrelli

Description

@apetrelli

UTF8StreamJsonParser creates a child context every time:

  • it encounters a property
  • if the property is collection-like a new context is born for every element in the collection.

TreeTraversingParser instead creates a child context every time a new object has been created.
The result is that, for collection-like properties, the current value of the current context is first set with the container object, then with the collection itself.

I attach a small test case with two tests in which I created a DeserializerModifier to try to append a parent to all children objects.
jackson-bug-test.zip
I tried with versions 2.9.5 and 2.8.10.

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