From Gson 2.4 you can use alternate names. In your case, you can do it like this:
class A { @Expose @SerializedName(value = "a_id", alternate="b_id") private String id; }
The format is as follows:
@SerializedName(value="name1", alternate={"name2", "name3"})
More details here .
source share