grpc-web
grpc-web copied to clipboard
How to set array with grpc-web
hi, the proto file is as follow
message TestDetailInfo {
int32 testone = 1;
double testtwo = 2;
}
message CreateTest {
string test_name =1
repeated TestlDetailInfo test_detail_info = 2;
}
message NilRsp {
}
service TestService {
rpc CreateData(CreateTest) returns (NilRsp) {};
}
the js is as follow
let TestClient= new TestServiceClient("http://localhost")
let testparams={
testName:"test001",
testDetailInfo:[
{
"testone":"111",
"testtwo":2
}
]
};
let params= new CreateTest()
params.setTestName(testparams.testName);
params.setTestDetailInfo(testparams.testDetailInfo)
const call = TestClient.createData(params,metadata,
(err, response) => {
if(err == null){
}else{
}
});
and there is an error shows:
TypeError: c[e].toArray is not a function
https://developers.google.com/protocol-buffers/docs/reference/javascript-generated#repeated how to format the specified JavaScript array?
hi, have you resolve it? I have a same problem. https://github.com/grpc/grpc-web/issues/739