Hello jackson-user group,

I am trying to deserialize the following json string:

String json = 
"{\"actions\":[[\"set-device-id\",[\"radius-avp\",\"nas-identifier\"]]]}";


into the object:

@JsonFormat(shape=JsonFormat.Shape.ARRAY)

@JsonTypeName("set-device-id")
static public class SetDeviceId extends TransformAction {
    public RadiusAvp radiusAvp;
    public SetDeviceId() {}

...

}


Where TransformAction is this:

@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = 
JsonTypeInfo.As.WRAPPER_ARRAY, property = "name")
@JsonSubTypes({@JsonSubTypes.Type(TransformAction.SetDeviceId.class),...)}
@JsonTypeName("transform-action")
public abstract class TransformAction {

...

}


and RadiusAvp is:

@JsonTypeName("radius-avp")
public class RadiusAvp {

    public String attribute;

    public RadiusAvp(String attribute) {
        this.attribute = attribute;
    }

...

}


Doing this jackson errors:


Unexpected token (VALUE_STRING), expected START_ARRAY: need JSON Array to 
contain As.WRAPPER_ARRAY type information for class RadiusAvp at [Source: 


Is there any way of deserializing the provided json into SetDeviceId. I 
understand that Jackson doesn't seem to know about the RadiusAvp type since I 
provide no assignment to the SetDeviceId.radiusAvp field. Is there some Jackson 
annotation which is missing or wrong ?




-- 
You received this message because you are subscribed to the Google Groups 
"jackson-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jackson-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jackson-user/3a68b002-a7cf-40a3-b43f-c06a3de0f92f%40googlegroups.com.

Reply via email to