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

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

Open
denofiend opened this issue Dec 8, 2014 · 2 comments
Open

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

denofiend opened this issue Dec 8, 2014 · 2 comments

Comments

@denofiend
Copy link

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
Copy link
Author

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

@panuhorsmalahti
Copy link

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

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

No branches or pull requests

2 participants