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

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/protobuf.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/protobuf/bb037624-52c2-4f62-a20f-45ef3bc421e0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to