Hi,
I have an issue when I am using protobuf for serialization and deserialization
Scenario 1:
"profile" : {
"subscriptions" : [
{
"id" : "xxx",
"trigger" : {
"aboveBelow" : "above",
"threshold" : "200",
"accounts" : [
{
"number" : "029010101029200",
"pc" : "DDA",
"spc" : "CA",
"currency" : "DOP"
}
]
}
}]
}
Scenario 2:
"profile" : {
"subscriptions" : [
{
"id" : "xxx",
"trigger" : {
"aboveBelow" : "above",
"threshold" : "200",
"accounts" : [
{
"number" : "XXXXX",
"pc" : "XXX",
"spc" : "XXX",
"currency" : "XX",
"cardNumber":""
}
]
}
}]
}
Now both scenarios are valid but since the default for string in Protobuf is empty I cannot write a generic code for the variable cardNumber as in if I use the empty string check than my scenario 2 fails and if if I ignore the empty check my scenario 1 fails.
I am expecting the same json before and after serailization/deserialization . So is there a way I can have the string variables to have a default value when deserializing.
Thanks,
Joel