I have a class having following structure
public class Model {
@SerializedName("1")
private String name;
//Getters and setters
}
I need to serialize this class using gson so that i will get a output like
{"name":"Lorem Ipsum"}
instead of
{"1":"Lorem Ipsum"}
I know that removing @SerializedName("1") will solve my problem. But due to some reasons I cannot change or add anything in the Model class.
So is there any way to do that without removing the @SerializedName Annotation ? I am usig Gson 2.3.1