I have a Json response of the following type -
{
userName:"Jon Doe",
country:"Australia"
}
My User class looks like this -
public class User{
private String userName;
private Country country;
}
GSON parsing fails with the following error:
com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 3 column 18 path $[0].country
Is there any way to tell GSON to parse country into the Country object with my current JSON response?