I have a message structure like this:
message Command {
enum CommandType {
FOO = 0;
BAR = 1;
}
repeated CommandType command_type = 1;
}
message Reply {
// other fields here
optional Command commands = 4;
}
For the life of me, I can't seem to figure out the JS object notation that
will parse this correctly. I have tried
var Schema = require('protobuf').Schema,
schema = new Schema(fs.readFileSync('./messages.desc'),
Reply = schema.Reply;
var reply = Reply.parse(Reply.serialize({commands: [{command: {commandType:
"FOO"}}] });
But it always outputs commands as an empty object { }
I've been using node-protobuf for a while now, successfully, but it is not
clear to me how to map to js with a repeated enum type. What am I doing
wrong here?
--
You received this message because you are subscribed to the Google Groups
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/protobuf?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.