-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ProtoKt-generated Code is incompatible with google's gRPC stubs when it comes to builtin types (e.g. Empty
)
#173
Comments
Interesting find. We don't run into this issue internally since we follow Buf's style guide for services and create and name all request and response types and never use externally-defined messages in our API surfaces. That's what I recommend you do here as well, and I'll clarify this issue in the readme.
Since we rely on the |
The suggestion to use custom message types insead of In essence, this means that when using protokt alongside with Would that mean that you'd have to re-define all those message types yourself? Or is there another (general) solution? |
protokt regenerates those types as KtMessages under the An alternative solution I forgot to mention is that you can keep using the protokt/examples/grpc-kotlin/src/main/kotlin/io/grpc/examples/animals/AnimalsClient.kt Line 31 in 6319e17
|
okay, thanks for the info! |
I just upgraded to 0.9.0 and tried to migrate my codebase to use the gRPC stubs that google's
protoc-gen-grpc-kotlin
generates. However, I came across an issue with the predefinedgoogle.protobuf.Empty
type:ProtoKt has (also previously) supplied their own version of
Empty
, calledcom.toasttab.protokt.Empty
. This has worked fine until now, because gRPC-Kt uses their version ofEmpty
(calledcom.google.protobuf.Empty
) in the generated code. This then causes conflicts between theServiceGrpcKt
(google) and the[name]Grpc
(protokt) files.Since the protokt ecosystem (presumably) depends on their own classes, maybe a solution would be to expose the
google.protobuf.Empty
source as if it was a custom type, because all custom types get resolved properly.The text was updated successfully, but these errors were encountered: