Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to generate protobuffs with map types as return in service. #388

Open
Mythra opened this issue Jul 28, 2018 · 0 comments
Open

Unable to generate protobuffs with map types as return in service. #388

Mythra opened this issue Jul 28, 2018 · 0 comments

Comments

@Mythra
Copy link

Mythra commented Jul 28, 2018

I'm attempting to generate the protobuff for:

syntax = "proto2";

option java_multiple_files = true;
option java_package = "com.test.grpc";
option java_outer_classname = "TestProto";

package com.test.grpc;

message TestMsg {
  required string primary_key = 1;
  map<string, string> data = 2;
}

service TestSvc {
  rpc Store(String) returns (TestMsg);
}

However attempting to compile this proto results in an error:

 protoc -I ../../../proto/ --ruby_out ./lib ../../../proto/test_case.proto 
test_case.proto:11:3: Expected "required", "optional", or "repeated".
test_case.proto:11:6: Expected field name.

I've confirmed removing the map type causes the error to not be generated, and confirmed that removing the service TestSvc would also fix this issue.

I'm not sure if this is something I'm doing wrong with protobuffs, or if it's a problem with the compiler, but other language bindings seem to generate this code fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant