grpc / grpc-kotlin

Kotlin gRPC implementation. HTTP/2 based RPC
https://grpc.io/docs/languages/kotlin
Apache License 2.0
1.2k stars 166 forks source link

annotation error from generated proto files #499

Open zabakala opened 11 months ago

zabakala commented 11 months ago

Hi. Would you be able to assist me in the following error inside IntelliJ? Anytime I generate kotlin files from the proto ones I end up with an erroneous generated code.

My build.gradle.ts:

protobuf {
    protoc{
        artifact = "com.google.protobuf:protoc:3.25.1"
    }
    plugins {
        create("grpc") {
            artifact = "io.grpc:protoc-gen-grpc-java:1.60.0"
        }
        create("grpckt") {
            artifact = "io.grpc:protoc-gen-grpc-kotlin:1.4.1:jdk8@jar"
        }
    }
    generateProtoTasks {
        all().forEach {
            it.plugins {
                create("grpc")
                create("grpckt")
            }
            it.builtins {
                create("kotlin")
            }
        }
    }
}

The proto source file:

syntax = "proto3";

package com.heu.malheu.service;

option java_outer_classname = "CustomerProto";
option java_multiple_files = true;

service Customer {
  rpc getByEmail(ByEmailRequest) returns (byEmailReply) {}
}

message ByEmailRequest {
  string name = 1;
}

message byEmailReply {
  string message = 1;
}

...and the result:

annotationerror

jamesward commented 11 months ago

For the examples in this repo, I'm not able to reproduce that: image

Can you create a reproducer for this?