My guess would be that ENUM is just a wrong TType that's not really used in
the code.

Over the wire we just write/read enums as i32s. And you might have already
noticed that it's not in the spec.

On Thu, Oct 13, 2022 at 1:19 AM Jiayu Liu <ji...@hey.com.invalid> wrote:

> Hi thrift-dev,
>
> I would like to know more about the context of TType in Java,
> specifically when ENUM was introduced in [1] in 2009, it is placed with
> value 16 (binary protocol) but in swift [2] it is utf8, in delphi [3]
> uuid, in C# [4] uuid, and per spec [5] uuid.
>
> Using 16 for uuid will possibly break Java but i wasn't sure why enum
> wasn't adapted in the binary protocol spec.
>
> Thanks!
>
> [1]:
>
> https://svn.apache.org/viewvc/incubator/thrift/trunk/lib/java/src/org/apache/thrift/protocol/TType.java?r1=882211&r2=882210&pathrev=882211
> [2]:
>
> https://github.com/apache/thrift/blob/0223d6346675c5089c2a2de5fb6f3858e599c9a9/lib/swift/Sources/TProtocol.swift#L43
> [3]:
>
> https://github.com/apache/thrift/blob/0223d6346675c5089c2a2de5fb6f3858e599c9a9/lib/delphi/src/Thrift.Protocol.pas#L53
> [4]:
>
> https://github.com/apache/thrift/blob/0223d6346675c5089c2a2de5fb6f3858e599c9a9/lib/netstd/Thrift/Protocol/Entities/TType.cs#L36
> [5]: https://github.com/apache/thrift/blob/master/doc/specs/thrift-
> binary-protocol.md#struct-encoding
> <https://github.com/apache/thrift/blob/master/doc/specs/thrift-binary-protocol.md#struct-encoding>
>

Reply via email to