I have some JSON that I am deserializing using Gson.
{
\"resp\": {
\"posts\": [
{
...
\"public\": true,
...
}]
}
My proble
You could use a different name for your field, using gson's Field Naming Support.
public class Post {
@SerializedName("public")
private boolean isPublic;
...
}
Worth a quick note that you need to include gson.annotations or SerializedName for this to compile as not part of the base gson.Gson package:
import com.google.gson.annotations.SerializedName;