0

I wrote down a proto like this:

message VenueCalibrationData
{
    string sportType = 1;
    int64 lastModifiedCalibration = 2;
    BoolVal isPrimary = 3; 
}

message BoolVal
{
    bool value = 1;
}

However when I checked my client side log I got:

{ "venueDataCalibration": [ { "sportType": "BASEBALL", "lastModifiedCalibration": "1667988929", "isPrimary": { "value": true } }, { "sportType": "SOCCER", "lastModifiedCalibration": "1667988909", "isPrimary": { } } ] }

And my server is indeed sending the false message as empty.. but when I go over and check:

 venueCalibDataProto.IsPrimary = new BoolVal();
 venueCalibDataProto.IsPrimary.Value = (folderName.ToLower() == primaryCalib.ToLower());

I put venueCalibDataProto.IsPrimary.Value.ToString() to check the value, I see False written. What am I doing wrong?

Yuki1112
  • 365
  • 2
  • 12
  • I think due to minimizing size all default values are left out in protobuf – Klamsi Nov 10 '22 at 11:36
  • 1
    Is this the answer you are looking for? https://stackoverflow.com/questions/31021797/protobuf-doesnt-serialize-default-values – Klamsi Nov 10 '22 at 11:46

0 Answers0