Uploaded image for project: 'Beam'
  1. Beam
  2. BEAM-2959

Fix proto enums to not use 0 for a valid value

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P2
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.2.0
    • Component/s: beam-model
    • Labels:
      None

      Description

      Proto3 uses 0 as the default value for enums and does not encode it on the wire which means that you can not detect the difference between a value that is unset and an enum that is set but has a value of zero.

      Defining an "YYY_UNSPECIFIED" is considered a best practice. Unfortunately this is not done automatically because of proto2 compatibility within proto3.

        Attachments

          Activity

            People

            • Assignee:
              lcwik Luke Cwik
              Reporter:
              lcwik Luke Cwik
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: