Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-2011

Go JSON reads/writes incorrect data for list<>

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Go - Library
    • Labels:
    • Patch Info:
      Patch Available

      Description

      Example to reproduce: Given a list<string> holding one "element", the following JSON data are rendered:

      "lst":[11,1,"element"]

      The expected sequence would be:

      "lst":["str",1,"element"]

      This is due to the method OutputElemListBegin(), which JSON inherits from SimpleJSON. This method writes the field type as a byte value, without passing it through TypeIdToString(), which is incorrect for JSON.


      EDIT: Similar problem appears when a "lst" should be read.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                jensg Jens Geyer
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: