kitex-contrib / codec-dubbo

支持 kitex <-> dubbo 互通的 dubbo 协议编解码器。
Apache License 2.0
16 stars 14 forks source link

[P2] Support Java Wrapper Class natively #69

Open felix021 opened 9 months ago

felix021 commented 9 months ago

As optional keyword is not applicable to function arguments/response, Kitex will always generate non-pointer basic types, which makes it incompatible with Java methods defined with wrapper classes (such as Integer) as its arguments/response.

To improve the compatibility, we can define java wrapper classes in java.thrift and implement them as type aliases to the corresponding basic types in github.com/kitex-contrib/codec-dubbo/tree/main/java, which will be "recogonized" as struct types by Kitex and present in their pointer form in the generated code.

Before implemented, the quickest workaround is to add another method in the java server as an adaptor.