Uploaded image for project: 'ProtoStream'
  1. ProtoStream
  2. IPROTO-243

JSonUtil field 18 as boolean considered as a string

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Critical Critical
    • 4.5.0.Final
    • None
    • None
    • None
    • False
    • False
    • None

      When creating an protobuf with at least 17 fields, if the 17th is not of type String, it is still considered as string causing downstream problems (example when trying to save the the DB.
      William Burns identified the cause

      William Burns: I was able to reproduce it by adding 20 fields, for some reason the 18th field from the parsed json is a string. The store has the proper type and thus it fails to convert the string "false" to a boolean

      William Burns: The cause is because of this line https://github.com/infinispan/protostream/blob/main/core/src/main/java/org/infinispan/protostream/impl/JsonUtils.java#L578

      William Burns: I need to look into why this is hardcoded like that

      William Burns: It looks like this is a special case for when an enum is in a message https://github.com/infinispan/protostream/blob/main/core/src/main/java/org/infinispan/protostream/WrappedMessage.java#L297.

      TBH I am not sure what the fix is for this.

            wburns@redhat.com Will Burns
            thierry@avanco.be Thierry De Leeuw (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: