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);
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);