connectrpc / connect-kotlin

The Kotlin implementation of Connect: Protobuf RPC that works.
https://connectrpc.com/docs/kotlin/getting-started
Apache License 2.0
104 stars 17 forks source link

Ensure generation on non-packaged protobuf files #3

Closed buildbreaker closed 1 year ago

buildbreaker commented 1 year ago

Generating a .proto file with no package defined causes an error on generation:

Failure: plugin "buf.build/bufbuild/connect-kotlin:v0.1.1" exited with non-zero status 1: Exception in thread "main" java.lang.IllegalArgumentException: couldn't make a guess for .HelloRequest
        at com.squareup.kotlinpoet.ClassName$Companion.bestGuess(ClassName.kt:205)
        at build.buf.protocgen.connect.Generator.interfaceMethods(Generator.kt:128)
        at build.buf.protocgen.connect.Generator.serviceClientInterface(Generator.kt:112)
        at build.buf.protocgen.connect.Generator.parseFile(Generator.kt:89)
        at build.buf.protocgen.connect.Generator.generate(Generator.kt:73)
        at build.buf.protocgen.connect.internal.Plugin.run(Plugin.kt:121)
        at build.buf.protocgen.connect.internal.Plugin.run$default(Plugin.kt:86)
        at build.buf.protocgen.connect.Main$Companion.main(Main.kt:23)
        at build.buf.protocgen.connect.Main.main(Main.kt)
buildbreaker commented 1 year ago

Fixed in https://github.com/bufbuild/connect-kotlin/pull/7

Looking to fix for release 0.1.2