Skip to content

Add method ObjectWriter.forBaseType(class/JavaType) for tricky polymorphic cases #789

Closed

Description

@cowtowncoder

Currently forcing of type information for ObjectWriter only allows specifying both implementation type to use (for locating JsonSerializer) AND "base type" used by TypeSerializer. Since behavior varies between the two, there are cases where one would want to use different type, to specifically force use of a particular base type to produce type id(s) desired.

As far as I can see, this is only needed on writer (serialization) side: during deserialization, there is no distinction between actual runtime type (of an instance) and base type, and a single type works for both.

Activity

  1. cowtowncoder commented on Jun 18, 2015

    @cowtowncoder
    MemberAuthor

    I started implementation for this one, but after a while realized that I don't actually know the expected use. About the only case I can think of it could solve is related to using default typing, and forcing base type to be, say, java.lang.Object. But I suspect there should be other use cases for handling things like Collections and Maps. If so, however, use case is needed to have tests to verify feature actually works as intended, and solves the problem.
    So this can wait at least until 2.7 at this point.

  2. cowtowncoder commented on Sep 16, 2019

    @cowtowncoder
    MemberAuthor

    Close this, reopen #1093.

  3. added
    duplicate
    and removed on Sep 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicate

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions