chrisdew / protobuf

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

Does not support parameter name like "a_b_c" #50

Open lmyzzu opened 9 years ago

lmyzzu commented 9 years ago

if use parameter name like "a_b_c" , get the exception follow : Can't parse message of type "***" because it is missing required fields: "a_b_c"

because object.serialize() not handle the fields: "a_b_c" //common.proto package org.commmon; message BaseInfo { required string id = 1; required int32 last_go_time = 8; } var fs = require('fs'); var Schema = require('protobuf').Schema;

var common = new Schema(fs.readFileSync("./protos/common.desc")); var Info = fishingjoy3["org.commmon.BaseInfo"]; var pmsg = Info.serialize({ "id": 'id', "last_go_time": 12452475 }); console.log(pmsg.length); var jmsg=uInfo.parse(pmsg); console.log(jmsg);