google api - how to write proto file with bytes embedded message -


i have encoded binary follows

0a 16 0a 06 72 63 6e 33 31 72 12 0a 65 37 36 30 34 32 33 35 32 37 1a 00 20 01 2a 06 34 34 38 37 38 

i not sure how write proto file reflecting binary. know message contents.

1. first 2 bytes indicate embedded message 22 bytes in length 2. inside embedded message there 3 fields (three strings) 3. rest of message 2 fields 

how write .proto file reflect above binary ?

message userinfo {         required string username = 1;         required string usserid  = 2;         optional string extrainfo= 3; }  message senduserrequest {         required userinfo uinfo = 1;         ... } 

the bytes provided appear missing byte. added 0 end, ran through protoc --decode_raw , got this:

1 {   1: "rcn31r"   2: "e760423527"   3: "" } 4: 1 5: "44878\000"  // (my added 0 byte shows here) 

so in addition wrote, senduserrequest should include 2 more fields:

optional int32 = 4; optional string b = 5; 

note there's no way tell correct names of these fields should be, nor whether they're required or optional. moreover, a technically of integer types.


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -