Skip to content

gRPC does not work if proto contains imports (and fails on simple case) #272

Open
@rogchap

Description

@rogchap

Describe the bug
I was unable to get a simple gRPC example working. There also seems to be issues if you import any messages and also does not work with any well known proto types eg. google.protobuf.Timestamp

To Reproduce
Simple proto causes this error when trying to select a request from the dropdown:
image

syntax = "proto3";
package main;

service ClickE {
    rpc Inc(Empty) returns (Count);
    rpc GetCount(Empty) returns (Count);
    rpc Subscribe(Empty) returns (stream Count);
}

message Empty {}

message Count {
    int32 value = 1;
}

Also any proto that has an import statement will fail to read the methods:

syntax="proto3";
import "message.proto";
import "google/protobuf/timestamp.proto";
package messenger;

Expected behavior

  1. The first example shoud "just work", and the error message does not give me any information on what the problem is.

  2. import statements should be followed and well known types should be automatically discovered. Most gRPC tools allow you to specify multiple proto files and also reference folders on where to read other imported files.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: MacOS Catalina
  • Browser ?? why this is relevant?
  • Version 0.4

Additional context
More testing is required around gRPC to make this useful beyond the very simple case.

I also make use of custom options in my gRPC services, which also may cause issues with your custom parser eg:

message Chat {
    google.protobuf.Timestamp created_at = 3 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
}

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