Any way to serialize a Scala case class to JSON and have the ability to provide custom serialized names ?
For example, In Java this can be done using the Gson library :
public class SomeClassWithFields {
@SerializedName("name") private final String someField;
private final String someOtherField;
public SomeClassWithFields(String a, String b) {
this.someField = a;
this.someOtherField = b;
}
}
I tried doing this in Scala :
case class SomeClassWithFields(@SerializedName("name") someField:String)
but it seems to have no effect .
Any thoughts ?