Skip to content

Support naive deserialization of Serializable values as "untyped", same as java.lang.Object #2115

@chrylis

Description

@chrylis

Currently, Jackson is willing to deserialize JSON into a target of type Object as simple Java types--String, Integer, Map, and such. This means that I can successfully deserialize a target property of

Map<String, ? extends Object> miscProperties;

with the results being objects of basic types. So far so good.

However, if I instead I use Serializable as the generic bound, Jackson complains that

Can not construct instance of java.io.Serializable: abstract types either need to be mapped to concrete types, have custom deserializer, or contain additional type information

While in the case of general type resolution I understand the rationale for what's going on here, in practice every single type that Jackson will produce when faced with a deserialization into Object is Serializable, and it should treat a target of Serializable identically to a target of Object.

I am using 2.8.11.2.

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