You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test.proto:
message test{
repeated int32 history = 1;
}
my nodejs code:
var Schema = require('protobuf').Schema;
var schema = new Schema(fs.readFileSync(test.desc'));
var req_ob = {
hisatory: []
};
var Req = schema['test'];
var s = Req.serialize(req_ob);
console.log("request:" + JSON.stringify(req_ob));
var Res = schema['test'];
var r = Req.parse(s);
console.log("response:" + JSON.stringify(r));
console:
request:{"hisatory":[]}
response:{}
why response is {}, not {"hisatory":[]} ???
The text was updated successfully, but these errors were encountered:
test.proto:
message test{
repeated int32 history = 1;
}
my nodejs code:
var Schema = require('protobuf').Schema;
var schema = new Schema(fs.readFileSync(test.desc'));
var req_ob = {
hisatory: []
};
var Req = schema['test'];
var s = Req.serialize(req_ob);
console.log("request:" + JSON.stringify(req_ob));
var Res = schema['test'];
var r = Req.parse(s);
console.log("response:" + JSON.stringify(r));
console:
request:{"hisatory":[]}
response:{}
why response is {}, not {"hisatory":[]} ???
The text was updated successfully, but these errors were encountered: