Skip to content

Commit

Permalink
rpc (fix): Fix generated client interface (#3830)
Browse files Browse the repository at this point in the history
  • Loading branch information
xerial authored Feb 12, 2025
1 parent 0ee8b7a commit bbc9ba2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,13 @@ object HttpClientIR extends LogSupport {
) extends ClientCodeIR {
def typeArgString =
typeArgs
.map(arg =>
if (arg.rawType.isAssignableFrom(classOf[Rx[_]]) && arg.typeArgs.size > 0)
// Extract Rx element type
arg.typeArgs(0)
else
arg
)
.map(arg => HttpClientGenerator.fullTypeNameOf(arg))
.mkString(", ")
def clientMethodName = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ object RPCClientGenerator extends HttpClientGenerator {
m.httpMethod match {
case HttpMethod.GET =>
s"""def ${m.name}(${inputArgs.mkString(", ")}): ${returnType} = {
| client.readAs[${m.returnType.fullTypeName}](Http.GET(s"${m.path}"))
| client.readAs[${returnElementType}](Http.GET(s"${m.path}"))
|}""".stripMargin
case _ =>
val args = Seq.newBuilder[String]
Expand Down

0 comments on commit bbc9ba2

Please sign in to comment.