Open
Description
I feel that I use the plugin in a wrong way or there is something not designed correctly.
example:
I have directory with three files
status.proto
message Success {
}
and
package svcs
servicesA.proto
package svcs
import "status.proto"
service ServiceA {
... rpcs
}
service.B.proto
package svcs
import "status.proto"
service ServiceB {
... rpcs
}
running protoc 3 times (serviceA.proto, serviceB.proto status.proto) in that order:
- svcs.py with content of A
- svcs.py with content of B
- svcs.py with content of status.proto
I have been using protobuf for more than 12 years, but this is not correct. It is normal to have one package with multiple file being included around and similar things. the generator must either append or somehow deal with it. It is not correct expectation that each file will have a different namespace
mine current workaround - still I need to test it
for proto_file in request.proto_file:
- out = proto_file.package
- if out == "google.protobuf":
+ out = proto_file.package + "." + proto_file.name.rsplit('.', 1)[0]
+ if out.startswith("google"):
continue