akka-grpc
akka-grpc copied to clipboard
Metadata message type in PowerAPI can cause a name collision
Versions used
Akka gRPC 1.1.1
, but this is also present in main
and on 2.1.3
/2.1.4
.
Akka version:
Unimportant, but 2.6
.
Expected Behavior
- Create a proto file with
Metadata
as a message name. - Compile an akka-grpc server in power mode (PowerApi)
- Everything should compile normally.
Actual Behavior
- Create a proto file with
Metadata
as a message name. - When you compile akka-grpc server in power mode, an internal proto file collides: https://github.com/akka/akka-grpc/blob/main/codegen/src/main/twirl/templates/ScalaServer/PowerApiTrait.scala.txt#L19
We were able to verify that this can be fixed by foregoing the import here, and instead using the full path akka.grpc.scaladsl.Metadata
on line 19. E.g.,
def @{method.nameSafe}(in: @method.parameterType, metadata: akka.grpc.scaladsl.Metadata)