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

Support reflection capability like protobuf

    XMLWordPrintableJSON

Details

    • Wish
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • Go - Library
    • None

    Description

      Hello, Thrift team. I noticed that when using Protobuf, it provides reflection capabilities that allow us to access metadata and use reflection in generated code, like this:
      ```

      msg := pbdemo.Request{Name: "abc"}
      m := msg.ProtoReflect()
      fds := m.Descriptor().Fields()
      fmt.Println("----- newReflect:")
      for k := 0; k < fds.Len(); k++

      {    fd := fds.Get(k)    fmt.Println(fd) }

       

      ```
      I'm wondering if Thrift can also support similar functionality? For example, can Thrift record this metadata in generated code and provide reflection capabilities similar to Protobuf? This would make code development more flexible. Thank you for your attention.

      Attachments

        Activity

          People

            Unassigned Unassigned
            heysmiley Lee Yun
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: