3kis commented on code in PR #12391: URL: https://github.com/apache/apisix/pull/12391#discussion_r2225117017
########## apisix/plugins/grpc-transcode/response.lua: ########## @@ -23,6 +23,46 @@ local string = string local ngx_decode_base64 = ngx.decode_base64 local ipairs = ipairs local pcall = pcall +local type = type +local pairs = pairs +local setmetatable = setmetatable + +pb.option "decode_default_array" +-- Protobuf repeated field label value +local PROTOBUF_REPEATED_LABEL = 3 +local repeated_label = PROTOBUF_REPEATED_LABEL + +local function fetch_proto_array_names(proto_obj) + local names = {} + if type(proto_obj) == "table" then + for k,v in pairs(proto_obj) do + if type(v) == "table" then + local sub_names = fetch_proto_array_names(v) + for sub_name,_ in pairs(sub_names) do + names[sub_name] = 1 + end + end + end + if proto_obj["label"] == repeated_label then + names[proto_obj["name"]] = 1 Review Comment: done. pls approve again. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org