Uploaded image for project: 'Kogito'
  1. Kogito
  2. KOGITO-7538

gRPC enum behaviour


    • False
    • None
    • False
    • ---
    • ---
    • 2022 Week 26-28 (from Jun 27), 2022 Week 29-31 (from Jul 18)

      gRPC server does not include in the response 0 enum values.
      It is up to the client to intepret if the no presence of the enum means that the default value should be used or not when the field is not in the server response.
      If we assume the default value should be included, this means that if enum with 0 value is semantically relevant (it is not UNKNOWN), it might lead to cases where a server does not really intend to signal that value but we interpret it is doing so.
      If we do not return anything, users will complain the value they are setting it is not being included in the json (see https://issues.redhat.com/browse/KOGITO-7535)
      Since there is not a good solution for this, we need to let the users decide what they want, therefore we will be adding a 'kogito.grpc.enum.includeDefault'. By default, it will be false, meaning default would be equivalent to null (and not included in the json). If true, the field will be always included in the json, with the value returned by the server or the default (0).
      In any case, grpc servers are encouraged to follow best practises and define as default enum (0) a not semantically relevant one (UNKNOWN)

            ftirados Francisco Javier Tirado Sarti
            ftirados Francisco Javier Tirado Sarti
            0 Vote for this issue
            1 Start watching this issue