@@ -140,27 +140,28 @@ std::unordered_set<std::string> GetMethodNames(
140140
141141} // namespace
142142
143- std::vector<std::string> GetMixinProtoPaths (YAML::Node const & service_config) {
144- std::vector<std::string> proto_paths;
143+ std::vector<MixinService> GetMixinServiceProto (
144+ YAML::Node const & service_config) {
145+ std::vector<MixinService> proto_paths;
145146 if (service_config.Type () != YAML::NodeType::Map) return proto_paths;
146147 auto const & apis = service_config[" apis" ];
147148 if (apis.Type () != YAML::NodeType::Sequence) return proto_paths;
148149 for (auto const & api : apis) {
149150 if (api.Type () != YAML::NodeType::Map) continue ;
150151 auto const & name = api[" name" ];
151152 if (name.Type () != YAML::NodeType::Scalar) continue ;
152- auto const package_path = name.as <std::string>();
153+ auto const service = name.as <std::string>();
153154 auto const & mixin_proto_path_map = GetMixinProtoPathMap ();
154- auto const it = mixin_proto_path_map.find (package_path );
155+ auto const it = mixin_proto_path_map.find (service );
155156 if (it == mixin_proto_path_map.end ()) continue ;
156- proto_paths.push_back (it->second );
157+ proto_paths.push_back ({ it->first , it-> second } );
157158 }
158159 return proto_paths;
159160}
160161
161- std::vector<std::string> GetMixinProtoPaths (
162+ std::vector<MixinService> GetMixinServiceProto (
162163 std::string const & service_yaml_path) {
163- return GetMixinProtoPaths (YAML::LoadFile (service_yaml_path));
164+ return GetMixinServiceProto (YAML::LoadFile (service_yaml_path));
164165}
165166
166167std::vector<MixinMethod> GetMixinMethods (YAML::Node const & service_config,
@@ -173,15 +174,16 @@ std::vector<MixinMethod> GetMixinMethods(YAML::Node const& service_config,
173174 << service.full_name ();
174175 }
175176 std::unordered_set<std::string> const method_names = GetMethodNames (service);
176- auto const mixin_proto_paths = GetMixinProtoPaths (service_config);
177+ auto const mixin_proto_paths = GetMixinServiceProto (service_config);
177178 auto const mixin_http_overrides = GetMixinHttpOverrides (service_config);
178179
179180 for (auto const & mixin_proto_path : mixin_proto_paths) {
180- FileDescriptor const * mixin_file = pool->FindFileByName (mixin_proto_path);
181+ FileDescriptor const * mixin_file =
182+ pool->FindFileByName (mixin_proto_path.proto_file_path );
181183 if (mixin_file == nullptr ) {
182184 GCP_LOG (FATAL) << __FILE__ << " :" << __LINE__
183185 << " Mixin FileDescriptor is not found for path: "
184- << mixin_proto_path
186+ << mixin_proto_path. proto_file_path
185187 << " in service: " << service.full_name ();
186188 }
187189 for (int i = 0 ; i < mixin_file->service_count (); ++i) {
0 commit comments