include multiple import path?
See original GitHub issuethe protoc compilation support --proto_path=
to be specified multiple times, but this project seems not? because in a real large project, there are multiple proto definition files in a complex hierarchy …
$ protoc --help
Usage: protoc [OPTION] PROTO_FILES
Parse PROTO_FILES and generate output based on the options given:
-IPATH, --proto_path=PATH Specify the directory in which to search for
imports. May be specified multiple times;
directories will be searched in order. If not
given, the current working directory is used.
-oFILE, Writes a FileDescriptorSet (a protocol buffer,
--descriptor_set_out=FILE defined in descriptor.proto) containing all of
the input files to FILE.
I read the code seems requiring the include
to be one string only?
https://github.com/konsumer/grpc-dynamic-gateway/blob/master/index.js#L37
While, I’ve tried to touch the code a bit if I can make it working, but the grpc.load({ file: p, root: include })
call seems undocumented? the Documentation will definitely need to be improved, while, do you know if it support multiple include proto path?
https://grpc.io/grpc/node/grpc.html#.load__anchor
Another possibility is I see protoc can compile the complex hierarchy *.proto
into a single protoset binary file, and it’s well supported by tools like grpcurl
Are you aware if nodejs-grpc has similar protoset-files support? And add into this tool if possible
Issue Analytics
- State:
- Created 5 years ago
- Comments:14 (6 by maintainers)
Top GitHub Comments
Right, that’s why we have the new proto-loader API, that offers a bit more options when it comes to this problem.
I can possibly try to make a PR to use
@grpc/proto-loader
; while I am waiting some response from dcodeIO/protobuf.js#1117 the protoset is a different approach to tackle multi*.proto
files situation