Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conflict Messages during loadSchema #3130

Open
jianchaoxudd opened this issue Oct 1, 2024 · 0 comments
Open

Conflict Messages during loadSchema #3130

jianchaoxudd opened this issue Oct 1, 2024 · 0 comments

Comments

@jianchaoxudd
Copy link

Hi team,

We are seeing a protoForTesting/test/test_service_one.proto needs to import protoForTesting/test/test_service_two.proto exception when we load the following protobufs using SchemaLoader.

Proto directory structure:

- protoForTesting
   - common
       - common.proto
   - test
       - test_service_one.proto
       - test_service_two.proto

common.proto (NOTE: no package definition):

syntax = "proto3";

message Common {

}

test_service_one.proto

syntax = "proto3";

package test;

import "common/common.proto";

service TestingServiceOne {

  rpc TestingMethod(TestingServiceOneRequest) returns (TestingServiceOneResponse);
}

message TestingServiceOneRequest {
  Common common = 1;
}

message TestingServiceOneResponse {

}

test_service_two.proto: NOTE: the package definition is same as test_service_one.proto

syntax = "proto3";

package test;

service TestingServiceTwo {

  rpc TestingTwoMethod(TestingTwoRequest) returns (TestingTwoResponse);

}

message TestingTwoRequest {
}

message TestingTwoResponse {
}

message Common {

}

And here is how we load the protobuf.

SchemaLoader(fs).apply {
        initRoots(
            sourcePath = listof(Location.get("", "protoForTesting/test/test_service_one.proto"), Location.get("", "protoForTesting/test/test_service_two.proto")),
            protoPath = listof(Location.get("", "protoForTesting")),
        )
        permitPackageCycles = true
        loadExhaustively = true
    }.loadSchema()

So the test_service_one.proto is importing the Common from common/common.proto, however it seems the Loader is trying to load the Common from the test_service_two.proto and complain.

@jianchaoxudd jianchaoxudd changed the title Conflicted Messages during loadSchema Conflict Messages during loadSchema Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant