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

fix: grpc-transcode request support object array #7231

Merged
merged 13 commits into from
Jun 17, 2022

Conversation

Jon-Gaara
Copy link
Contributor

@Jon-Gaara Jon-Gaara commented Jun 10, 2022

Description

grpc-trancode if request have object array,upstream accept is empty

Fixes #5591

Checklist

  • I have explained the need for this PR and the problem it solves
  • I have explained the changes or the new features added to this PR
  • I have added tests corresponding to this change
  • I have updated the documentation to reflect this change
  • I have verified that this change is backward compatible (If not, please discuss on the APISIX mailing list first)

@Jon-Gaara Jon-Gaara changed the title fix: grpc-transcode support fix: grpc-transcode request support object array Jun 10, 2022
Copy link
Member

@spacewander spacewander left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make the CI pass, thanks!

@@ -147,6 +147,22 @@ function _M.map_message(field, default_values, request_table)
if ty ~= "enum" and field_type:sub(1, 1) == "." then
if request_table[name] == nil then
sub = default_values and default_values[name]
elseif core.table.isarray(request_table[name]) then
local sub_array = core.table.new(#request_table[name],0)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
local sub_array = core.table.new(#request_table[name],0)
local sub_array = core.table.new(#request_table[name], 0)

@@ -147,6 +147,22 @@ function _M.map_message(field, default_values, request_table)
if ty ~= "enum" and field_type:sub(1, 1) == "." then
if request_table[name] == nil then
sub = default_values and default_values[name]
elseif core.table.isarray(request_table[name]) then
local sub_array = core.table.new(#request_table[name],0)
for i,value in ipairs(request_table[name]) do
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
for i,value in ipairs(request_table[name]) do
for i, value in ipairs(request_table[name]) do

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have modified and submitted,but the CI not pass

@spacewander
Copy link
Member

Let's make the lint pass with reindex: https://github.com/apache/apisix/runs/6855357196?check_suite_focus=true

@spacewander spacewander merged commit 2ed96c0 into apache:master Jun 17, 2022
spacewander added a commit to spacewander/incubator-apisix that referenced this pull request Jun 20, 2022
Signed-off-by: spacewander <spacewanderlzx@gmail.com>
spacewander pushed a commit to spacewander/incubator-apisix that referenced this pull request Jun 20, 2022
Co-authored-by: jon.yu <jon.yu@ambergroup.io>
spacewander pushed a commit that referenced this pull request Jun 20, 2022
Co-authored-by: jon.yu <jon.yu@ambergroup.io>
spacewander pushed a commit that referenced this pull request Jun 30, 2022
Co-authored-by: jon.yu <jon.yu@ambergroup.io>
Liu-Junlin pushed a commit to Liu-Junlin/apisix that referenced this pull request Nov 4, 2022
Co-authored-by: jon.yu <jon.yu@ambergroup.io>
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

Successfully merging this pull request may close these issues.

http json params to grpc service have discarded some params when using grpc transcode
4 participants