grpc-kotlin icon indicating copy to clipboard operation
grpc-kotlin copied to clipboard

annotation error from generated proto files

Open zabakala opened this issue 1 year ago • 1 comments

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

zabakala avatar Dec 22 '23 10:12 zabakala

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

Can you create a reproducer for this?

jamesward avatar Dec 22 '23 22:12 jamesward