Skip to content

Improve ObjectWriter.forType() to avoid forcing base type for container types #727

@cowtowncoder

Description

@cowtowncoder

(for background, see FasterXML/jackson-jaxrs-providers#60)

ObjectWriter has forType() method that allows forcing of full type to use for serialization, and it works reasonable well for many use cases. But it does not work well for one specific class of problems; that of generic Collection (and Map) types with heterogenous non-polymorphic content. In those cases serialization will use base class serializer, which often is not what is wanted.

If possible, it would be good to avoid forcing use of base type for content values.

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