Actual result
{ "animal keeper" : 1, "animal color" : "red" }
PS I came from java and there we successfully used (for example) com.google.api.client.util.Value attribute to specify [de]serialized string value for each enum member:
public enum CardStatus {
@Value("active")
ACTIVE,
@Value("expired")
EXPIRED,
@Value("blocked")
BLOCKED
}
public class Card {
@Key("status")
private CardStatus status;
@Key("card id")
private String id;
}
So, serialized example of Card:
{ "card id" : "101010", "status" : "expired" }
PS com.google.api.client.util.Value is in com.google.http-client:google-http-client-android:1.22.0 or com.google.http-client:google-http-client-jackson2:1.22.0
PS I tested code of merge request #64 and it gave me:
{ "animal color" : "red", "animal keeper" : "Mary" }
As you see, sadly, DataMember attribute ignored
What I mean:
Suppose, we have following instance of Animal: new Animal() { Keeper = "Mary Rose, Color = "red" }
I uncomment
to make DataContract/DataMember attributes used in serialization.
Expecting serialized result: { "animal keeper" : "Mary Rose", "animal color" : "red" }
Actual result { "animal keeper" : 1, "animal color" : "red" }
PS I came from java and there we successfully used (for example) com.google.api.client.util.Value attribute to specify [de]serialized string value for each enum member:
So, serialized example of Card: { "card id" : "101010", "status" : "expired" }
PS com.google.api.client.util.Value is in com.google.http-client:google-http-client-android:1.22.0 or com.google.http-client:google-http-client-jackson2:1.22.0
PS I tested code of merge request #64 and it gave me: { "animal color" : "red", "animal keeper" : "Mary" } As you see, sadly, DataMember attribute ignored