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

Generated HTML/Graphviz lists referenced enum identifiers as UNKNOWN.

    XMLWordPrintableJSON

Details

    • Patch Available

    Description

      The following is a sample thrift file which illustrates the problem:

      enum TestEnum {
        ONE,
        TWO,
        THREE,
        FOUR,
      }
      
      const map<TestEnum,string> TestMap = {
        TestEnum.ONE: "one",
        TestEnum.TWO: "two",
        Testenum.THREE: "three",
        TestEnum.FOUR: "four",
      }
      
      struct TestModel {
        1: TestEnum field = TestEnum.THREE;
      }
      

      I then generated HTML output from this via thrift --gen html foo.thrift.
      The constant map TestMap lists the identifier enums as UNKNOWN:

      { UNKNOWN = "one", UNKNOWN = "two", UNKNOWN = "three", UNKNOWN = "four" }

      It's the same thing with the default value of the struct:

      Key	Field	Type	Description	Requiredness	Default value
      1	field	TestEnum		default	UNKNOWN
      

      Attachments

        Activity

          People

            jensg Jens Geyer
            hsjunnesson Hans Sjunnesson
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: