I have a problem deserializing a JSON string using Jackson (but I have no problem serializing an object to JSON).
Below I present the classes I use. The problem come
I was facing the issue and none of the answers worked for me. it seems the exception thrown is very generic one and is thrown for n number of causes. So one fix may not work for everyone. My case: we have a json response in which creditcard is a complex type but optional. when there is no creditcard data, we were getting an empty string in response:
"creditcard":""
But Credit card is a complex type for us:
We figured out, if there is no creditcard data, we should have something like this in json response:
"creditcard":{}
and not "creditcard":""
it fixed this issue.