Is there any way in Gson to map multiple JSON fields to a single Java object member variable?
Let\'s say I have a Java class...
public class MyClass
In October 2015, Gson version 2.4 (changelog) added the ability to use alternate/multiple names for @SerializedName when deserializing. No more custom TypeAdapter needed!
Usage:
@SerializedName(value="name", alternate={"person", "user"})
https://www.javadoc.io/doc/com.google.code.gson/gson/2.6.2/com/google/gson/annotations/SerializedName.html