Skip to content

Commit 289ea30

Browse files
echistyakovfacebook-github-bot
authored andcommitted
Ensure stream types are added to metadata
Summary: As titled. Reviewed By: podtserkovskiy Differential Revision: D75326606 fbshipit-source-id: bf7247ecf43a89c28b53b95322bf86bffe86b39b
1 parent 913693e commit 289ea30

File tree

1 file changed

+13
-1
lines changed
  • third-party/thrift/src/thrift/compiler/generate/go

1 file changed

+13
-1
lines changed

third-party/thrift/src/thrift/compiler/generate/go/util.cc

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,8 @@ void codegen_data::compute_thrift_metadata_types() {
239239

240240
for (auto const& service : current_program_->services()) {
241241
for (const auto& func : service->functions()) {
242-
if (!is_func_go_server_supported(&func)) {
242+
if (!go::is_func_go_client_supported(&func) &&
243+
!go::is_func_go_server_supported(&func)) {
243244
continue; // Skip unsupported functions
244245
}
245246

@@ -256,6 +257,17 @@ void codegen_data::compute_thrift_metadata_types() {
256257
add_to_thrift_metadata_types(type, visited_type_names);
257258
}
258259
}
260+
if (func.stream() != nullptr) {
261+
auto type = func.stream()->elem_type().get_type();
262+
add_to_thrift_metadata_types(type, visited_type_names);
263+
if (func.stream()->exceptions() != nullptr) {
264+
for (const auto& exception :
265+
func.stream()->exceptions()->get_members()) {
266+
auto type = exception->get_type();
267+
add_to_thrift_metadata_types(type, visited_type_names);
268+
}
269+
}
270+
}
259271
}
260272
}
261273
}

0 commit comments

Comments
 (0)