
Level0.proto
syntax = "proto3";
package protobufs;
import "level1/Level1.proto";
message Level0Message {
Level1Message level1message = 1;
}Level1.proto
syntax = "proto3";
package protobufs.folderA;
import "level2/Level2.proto";
message Level1Message {
Level2Message level2Message = 1;
}Level2.proto
syntax = "proto3";
package protobufs.folderA.folderB;
message Level2Message {
string innerMost = 1;
}Compilation fails :
--
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 protobuf+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/protobuf/81E01306-D492-4B20-903C-E1943FCD86AA%40gmail.com.
syntax = "proto3";
package protobufs.level1;
import "level1/level2/Level2.proto";
message Level1Message {
Level2Message level2Message = 1;
}
On Aug 28, 2020, at 9:59 PM, Nadav Samet <thes...@gmail.com> wrote:
The imports in proto files are relative to the search path (what you provide by -I), not to the files. You either need to the Level2 directory under the protobuf directory, or change the import in Level1.proto to import "level1/level2/Level2.proto"
On Fri, Aug 28, 2020 at 9:54 PM Novice User <novice...@gmail.com> wrote:
I've nested proto (proto3) files [ Level0.proto depends on Level1.proto which in turn depend on Level2.proto] with the below tree structure :
<xT5gv.png>
---Nadav