-
Notifications
You must be signed in to change notification settings - Fork 11.1k
Closed
Description
The grpc_ruby_plugin protoc plugin has a bug in generating Ruby output for proto files with nested resources and using the ruby_package option.
The plugin works fine when using either nested resources or ruby_package, but not both.
What version of gRPC and what language are you using?
grpc 1.26.0
What operating system (Linux, Windows,...) and version?
OS X
What runtime / compiler are you using (e.g. python version or version of gcc)
Ruby 2.6.2
What did you do?
Create a simple proto file that illustrates the issue:
mkdir -p input
mkdir -p output
cat << 'EOF' >> input/ruby_package_bug.proto
syntax = "proto3";
package grpc_ruby.ruby_package.bug_example;
option ruby_package = "Ruby::Package::Example";
service RubyPackageService {
rpc GetInnerResource(GetInnerResourceRequest) returns (OuterResource.InnerResource) {
}
}
message GetInnerResourceRequest {
int32 id = 1;
}
message OuterResource {
int32 id = 1;
message InnerResource {
string name = 1;
}
}
EOFNow generate the ruby output using the following:
protoc ruby_package_bug.proto -I input --ruby_out=output --grpc_out=outputOr, if you are using the grpc-tools gem, using the following:
grpc_tools_ruby_protoc ruby_package_bug.proto -I input --ruby_out=output --grpc_out=outputWhat did you expect to see?
The service should generate the rpc with the correct resource Ruby::Package::Example::OuterResource::InnerResource:
rpc :GetInnerResource, Ruby::Package::Example::GetInnerResourceRequest, Ruby::Package::Example::OuterResource::InnerResourceWhat did you see instead?
The service generates the rpc with the resource Ruby::Package::Example::InnerResource, which does not exist:
rpc :GetInnerResource, Ruby::Package::Example::GetInnerResourceRequest, Ruby::Package::Example::InnerResourceAnything else we should know about your project / environment?
Nope.
Reactions are currently unavailable