You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
First of all, thank you for this wonderful library!
Unfortunately, we are facing an issue with a Generic model. I've modified one of the library test to match the use case:
@JsonObject
public class SimpleGenericModel<T> {
@JsonField
public String string;
@JsonField
public Date date;
@JsonField(name = "test_int")
public int testInt;
@JsonField(name = "test_long")
public long testLong;
@JsonField(name = "test_float")
public float testFloat;
@JsonField(name = "test_double")
public double testDouble;
@JsonField(name = "test_string")
public String testString;
@JsonField(name = "test_int_obj")
public Integer testIntObj;
@JsonField(name = "test_long_obj")
public Long testLongObj;
@JsonField(name = "test_float_obj")
public Float testFloatObj;
@JsonField(name = "test_double_obj")
public Double testDoubleObj;
@JsonField(name = "test_t")
public T testT;
@JsonField(name = "test_nested_generic")
public SimpleGenericModel<String> testNestedGeneric;
}
@JsonObject
public class AnotherClass {
@JsonField
public int value;
@JsonField
public String name;
}
Class com.bluelinelabs.logansquare.processor.model.SimpleGenericModel could not be mapped to a JSON object. Perhaps it hasn't been annotated with @JsonObject?
Is it a supported use case?
Please find below a link to the patch I used to highlight my issue:
Hi,
First of all, thank you for this wonderful library!
Unfortunately, we are facing an issue with a Generic model. I've modified one of the library test to match the use case:
The json looks like this:
Finally, I'm parsing this data using:
This code give me a:
Class com.bluelinelabs.logansquare.processor.model.SimpleGenericModel could not be mapped to a JSON object. Perhaps it hasn't been annotated with @JsonObject?
Is it a supported use case?
Please find below a link to the patch I used to highlight my issue:
nicolashaan@e2277e0
Best regards,
Nicolas
The text was updated successfully, but these errors were encountered: