You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2021/11/24 03:37:47 UTC

[GitHub] [apisix] xiaokunliu commented on issue #5591: http json params to grpc service have discarded some params when using grpc transcode

xiaokunliu commented on issue #5591:
URL: https://github.com/apache/apisix/issues/5591#issuecomment-977474026


   ok, my problem is in my IDL, the repeated type filed could not using json array to transfer grpc repeated type,like example as follow: 
   
   syntax = "proto3";
   package  api;
   service UserService {
    rpc UpdateUserById(UpdateUserByIdRequest) returns (UpdateUserByIdResult);
   
   message GetUserByIdResult {
     sint64 uid = 1;
     User user = 2;
   }
   
   message User {
     string name = 1;
     string email = 2;
     // address
     repeated UserAddress addresses = 3; 
     // profile
     UserProfile userProfile = 4;
     repeated sint64 tags = 5;
     repeated string hobbies = 6;
   }
   
   message UserProfile {
     sint64 uid = 1;
     string loginName = 2;
     string password = 3;
     sint64 balances = 4;
   }
   
   message UserAddress {
     string province = 1;
     string city = 2;
     string street = 3;
     string detail = 4;
   }
   }
   
   // the address could not get the value from http json array. and this is my curl request
   curl --location --request PUT 'http://hw-sg-nono-test1.livenono.com:19080/user/UpdateUserById' \
   --header 'Content-Type: application/json' \
   --data-raw '{
       "uid": 1111,
       "user": {
           "name": "uname",
           "email": "uemail",
           "addresses": [
               {
                   "province": "guangdong",
                   "city": "guangzhou",
                   "street": "haizhu",
                   "detail": "pazhou"
               }
           ],
           "userProfile": {
               "uid": "1111",
               "loginName": "user",
               "password": "user",
               "balances": 100
           },
           "tags": [1,2,3],
           "hobbies": ["footboall"]
       }
   }'
   
   


-- 
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-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org