Skip to content

Missing extensibility point for locating the TypeId #871

@cdockter

Description

@cdockter

The current extensibility point for all typing information is TypeDeserializer which has a lot of responsibilities.

I want to implement custom logic to determine the type id for an object even when the type information is not included in the input stream.

In order to accomplish this currently i had to extend AsPropertyTypeDeserializer with deserializeTypedFromArray() and several protected methods overridden.

It would be very useful to have an interface similar to the scope of TypeIdResolver to determine what the type id is for the current object.

This isolation of responsibilities allows for customization of the instance type determination while still leveraging the logic in classes such as AsPropertyTypeDeserializer.

This interface would encapsulate the logic currently implemented in AsArrayTypeDeserializer. _locateTypeId().

The interface method signatures could follow the lines of
public String getTypeId(JsonParser jp, DeserializationContext ctxt)
and
public String getTypeId(JsonParser jp, DeserializationContext ctxt, JavaType defaultType)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions