That was my expectation, but I just wondered if there is any option that I
can give to protoc to add a prefix to the canonical names.
On Friday, August 11, 2017 at 1:53:54 PM UTC-7, Feng Xiao wrote:
> On Fri, Aug 11, 2017 at 1:41 PM, 'Jungho Ahn' via Protocol Buffers <
>> I'm trying to import protos from a third party repo, but they don't have
>> proper canonical names.
>> For example, there is a repo X which has
>> a/p2.proto with (import "a/p1.proto")
>> Since 'a' is too generic, I'd like to add a kind of prefix to the
>> canonical names like "external/a/p1.proto", "external/a/p2.proto" to avoid
>> conflicts with existing protos.
>> But I'm not sure whether this possible since a/p2.proto imports p1.proto
>> as "a/p1.proto" already.
>> Is there any workaround for this?
> Unfortunately there isn't a workaround here. Basically "a/p1.proto"
> becomes the canonical name of that proto file and it can't be changed
> unless you can update all references of that import path. If repo X only
> provides the .proto files but not the generated code in their library, you
> can just update all the import paths in their protos. However, if generated
> code is part of X library, there isn't much you can do other than asking
> owners of X library to use a better path for their protos.
>> You received this message because you are subscribed to the Google Groups
>> "Protocol Buffers" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> To post to this group, send email to prot...@googlegroups.com
>> Visit this group at https://groups.google.com/group/protobuf.
>> For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
To post to this group, send email to firstname.lastname@example.org.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.