chrisdew / protobuf

Protocol Buffers for Node.JS
http://code.google.com/p/protobuf-for-node/
Apache License 2.0
234 stars 71 forks source link

[] serialize, then parse, but not get [], is {}, why? #46

Open denofiend opened 9 years ago

denofiend commented 9 years ago

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":[]} ???

denofiend commented 9 years ago

I use this module: https://github.com/fuwaneko/node-protobuf

panuhorsmalahti commented 9 years ago

That's the wrong protobuf module. Should be closed.