Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

defaultImpl configuration is ignored for WRAPPER_OBJECT #656

Closed
iovesnov opened this issue Dec 17, 2014 · 1 comment
Closed

defaultImpl configuration is ignored for WRAPPER_OBJECT #656

iovesnov opened this issue Dec 17, 2014 · 1 comment

Comments

@iovesnov
Copy link

I am using using jackson version 2.4.4.

I was answering on one of the questions on the stackoverflow and found that 'defaultImpl' configuration is ignored if to use 'WRAPPER_OBJECT' include type. Code example:

@JsonTypeInfo(use=JsonTypeInfo.Id.NAME, include= JsonTypeInfo.As.WRAPPER_OBJECT, defaultImpl = UnknownProduct.class)

After some debugging I found that this specific include type (WRAPPER_OBJECT) ignoring the defaultImpl configuration. Here is a constructor of the AsWrapperTypeDeserializer which takes defaultImpl class as a parameter but then ignore it:

public AsWrapperTypeDeserializer(JavaType bt, TypeIdResolver idRes,
        String typePropertyName, boolean typeIdVisible, Class<?> defaultImpl)
{
    super(bt, idRes, typePropertyName, typeIdVisible, null);
}

Other include types are working fine (deserializers are passing defaultImpl configuration into the super clas constructor)

@cowtowncoder
Copy link
Member

Sounds like a bug indeed, thank you for reporting!

cowtowncoder added a commit that referenced this issue Dec 17, 2014
cowtowncoder added a commit that referenced this issue Dec 17, 2014
asfgit pushed a commit to apache/usergrid that referenced this issue Aug 4, 2015
FasterXML/jackson-databind#656

Upgrades events to be polymorphic to allow for easy addition and mapping of events without 1 large class for all events
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants