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

Cannot Serialize Lists of Structs in C#

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • 0.6.1
    • None
    • C# - Compiler
    • None
    • Windows 7

    Description

      1. Create a file called test.thrift with the following content:

      struct TestStruct {
      1: i32 id
      2: string name
      }

      service TestService

      { list<TestStruct> GetTestStructs(1: i32 id) }

      2. Execute the following at the command line: thrift-0.6.1.exe --gen csharp test.thrift

      3. Open gen-csharp\TestService.cs and scroll down to line 298

      Note that oprot.WriteListEnd(); is inside the foreach loop. This means that this code will fail for any List that has more than one item.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              mikemorton Mike Morton
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: