Skip to content

@JsonSerialize(contentAs=superType) behavior disallowed in 2.7 #1178

Closed
@markwoon

Description

@markwoon

After updating to 2.7, I'm getting:

Failed to widen value type of [collection type; class java.util.SortedSet, contains [simple type, class org.pharmgkb.model.AccessionIdentifier]] with concrete-type annotation (value org.pharmgkb.model.BaseAccessionIdentifier), from 'getGenes': Class org.pharmgkb.model.BaseAccessionIdentifier not a super-type of [simple type, class org.pharmgkb.model.AccessionIdentifier]

The signature of the method in question is:

@JsonSerialize(contentAs = BaseAccessionIdentifier.class)
@JsonDeserialize(contentAs = BaseAccessionIdentifier.class)
public Set<AccessionIdentifier> getGenes() {
}

How am I suppose to annotate this to get it to work again?

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