Skip to content

Google proto import issues #5

@avyasbms

Description

@avyasbms

Hello @thinkerou

I have a proto file which imports Google proto, These were added so that it Grpc can also be hosted as REST endpoints. Though highly unnecessary, it remains in our proto file.

So I cannot use these proto files directly, Can you see if we can have this generate code for karate-grpc automation.

syntax = "proto3";

package myproto;

import "google/api/annotations.proto";


service myservice {
    rpc AnewServiee (MyRequest) returns (MyResponse) {
        option (google.api.http) = {
      post: "/mygrpcrest/AnewServiee"
      body: "*"
    };
    }
}


    message MyRequest {
        string id = 1;
    }

    message MyResponse {
        string id = 1;
        string title = 2;
        string parentId = 3;
    }
$mvn compile
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Detecting the operating system and CPU architecture
[INFO] ------------------------------------------------------------------------
[INFO] os.detected.name: osx
[INFO] os.detected.arch: x86_64
[INFO] os.detected.version: 10.14
[INFO] os.detected.version.major: 10
[INFO] os.detected.version.minor: 14
[INFO] os.detected.classifier: osx-x86_64
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building api-bdd 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- protobuf-maven-plugin:0.5.1:compile (default) @ api-bdd ---
[INFO] Will write descriptor set:
[INFO]  /karate-grpc/target/generated-resources/protobuf/descriptor-sets/karate-grpc.protobin
[INFO] Compiling 9 proto file(s) to /karate-grpc/target/generated-sources/protobuf/java
[ERROR] PROTOC FAILED: google/api/annotations.proto: File not found.
project/protos/Experiment.proto: Import "google/api/annotations.proto" was not found or had errors.

[ERROR] /karate-grpc/src/test/java/projects/project/protos/Experiment.proto [0:0]: google/api/annotations.proto: File not found.
project/protos/Experiment.proto: Import "google/api/annotations.proto" was not found or had errors.

[ERROR] /karate-grpc/src/test/java/projects/project/protos/category.proto [0:0]: google/api/annotations.proto: File not found.
project/protos/Experiment.proto: Import "google/api/annotations.proto" was not found or had errors.

[ERROR] /karate-grpc/src/test/java/projects/project/protos/filter.proto [0:0]: google/api/annotations.proto: File not found.
project/protos/Experiment.proto: Import "google/api/annotations.proto" was not found or had errors.

[ERROR] /karate-grpc/src/test/java/projects/project/protos/product.proto [0:0]: google/api/annotations.proto: File not found.
project/protos/Experiment.proto: Import "google/api/annotations.proto" was not found or had errors.

[ERROR] /karate-grpc/src/test/java/projects/project/protos/tax.proto [0:0]: google/api/annotations.proto: File not found.
project/protos/Experiment.proto: Import "google/api/annotations.proto" was not found or had errors.

[ERROR] /karate-grpc/src/test/java/projects/project/protos/item.proto [0:0]: google/api/annotations.proto: File not found.
project/protos/Experiment.proto: Import "google/api/annotations.proto" was not found or had errors.

[ERROR] /karate-grpc/src/test/java/projects/project/protos/user.proto [0:0]: google/api/annotations.proto: File not found.
project/protos/Experiment.proto: Import "google/api/annotations.proto" was not found or had errors.

[ERROR] /karate-grpc/src/test/java/projects/examples/helloworld.proto [0:0]: google/api/annotations.proto: File not found.
project/protos/Experiment.proto: Import "google/api/annotations.proto" was not found or had errors.

[ERROR] /karate-grpc/src/test/java/projects/examples/user.proto [0:0]: google/api/annotations.proto: File not found.
project/protos/Experiment.proto: Import "google/api/annotations.proto" was not found or had errors.

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.422 s
[INFO] Finished at: 2018-12-11T18:13:48+05:30
[INFO] Final Memory: 11M/155M
[INFO] ------------------------------------------------------------------------

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions