Open andrew-selvia opened 1 year ago
This seems like a bug, I think we may have prefixed with root which ends up wrong. 🤔
I have a fix for this in https://github.com/davenverse/http4s-grpc/pull/72, but unfortunately more things are broken for well-known types 😕
For example this generated code is broken:
_root_.org.http4s.grpc.codecs.ScalaPb.codecForGenerated(_root_.scala.Long)
Actually it's not clear to me at all how to use a Long
as a message type 🤔 I think we are going to have to redirect through the Int64Value
wrapper type somehow.
ScalaPB seems to be unwrapping into Long
automatically, though that really isn't a blocker. Routing through Int64Value
is preferable to invalid code.
Yes, to be clear, I'm saying we should still keep Long
in the signature, just behind-the-scenes we need to encode that through the Int64Value
wrapper to get a valid message.
Just confirming, #72 isn't fully ready to merge due to the issue mentioned here, right?
Ugh, yeah. ScalaPB does it so presumably we should be able to copy/adapt their approach.
do we need a lookup table for these well-known types ?
Based on my experiments, if a message contains a well-known type, http4s-grpc produces invalid code. For example, this protobuf:
produces the following code:
Notice how the return type has the invalid type prefix
_root_._root_
.ScalaPB seems to handle these alright. Will some additional sbt configuration make this work or is this a bug?