Skip to content

Make PolymorphicClassDescriptor retain type of the base class #595

@altavir

Description

@altavir

What is your use-case and why do you need this feature?
When using custom serializers ant tools one seldom needs to work with descriptors directly without a Decoder in those cases, PolymorphicClassDescriptor does not provide sufficient information since it is not possible to know, which field does it represent.

Describe the solution you'd like

The simplest solution is to use base class name for descriptor instead of Any. It will increase memory consumption because at the moment Polymorphic descriptor is a singleton, but I do not think it is critical. The state could be moved from PolymorphicSerializer into descriptor thus making API more uniform.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions