Skip to content

Missing properties from base class when recursive types are involved. #1647

@slobo-showbie

Description

@slobo-showbie

When a type hierarchy as follows is constructed and the base class' type is constructed first by the TypeFactory then serializing the sub class fails due to missing properties from the base class.

class Base implements IFace<Sub> { @JsonProperty int base = 1 }
class Sub { @JsonProperty int sub = 2 }
interface IFace<T> {}

Serializes sub as {"sub":2} where {"base":1,"sub":2} is expected.

I've created a minimal scenario of this bug here: https://github.com/slobo-showbie/jackson-recursive-type-bug
I've experienced this bug in 2.7.8, 2.8.8, and 2.8.8.1

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