i got a deserialization problem:
This is my class:
public class Response { private Object ResObj; private int ResInt; public Object getResObj() { return ResObj; } public int getResInt() { return ResInt; } } the JSON i want to deserialize is:
{"ResObj":{"ClientNum":"12345","ServerNum":"78945","IdNum":"020252"},"ResInt":0} I get this exception:
Exception in thread "main" com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "ResObj" , not marked as ignorable (0 known properties: ]) at [Source: java.io.StringReader@1f758500; line: 1, column: 20] (through reference chain: ["ResObj"]) I don't want to add:
@JsonIgnoreProperties(ignoreUnknown = true) because I want to get the ResObj...
if I add the annotation, it pass but it will set it as null .. which I don't want.