[protobuf] How to represent variable JSON object data with Proto definition

2016-11-15 Thread Bojan D
Newbie question... If I have the following sample "User" JSON data: { firstName: 'Bob' lastName: 'Smith', email: 'b...@gmail.com', metadata: { // a plain JS object that // - will always exist and be at least an empty {} object // - could potentially contain any number of prope

Re: [protobuf] How to represent variable JSON object data with Proto definition

2016-11-16 Thread Bojan D
this but can't seem to accomplish it. I must be missing something. Anyone have any ideas. Thanks for the help again. Bojan On Tuesday, 15 November 2016 15:57:20 UTC-4, Tim Kientzle wrote: > > > On Nov 15, 2016, at 9:15 AM, Bojan D > > wrote: > > Newbie question... If

Re: [protobuf] How to represent variable JSON object data with Proto definition

2016-11-16 Thread Bojan D
lso tried to encode from stringified JSON and still fails. When there is "metadata" it crashes. I think I am doing something dumb but I am not sure what. Thanks. On Wednesday, 16 November 2016 13:58:44 UTC-4, Tim Kientzle wrote: > > I think we need more details: > >Are yo

Re: [protobuf] How to represent variable JSON object data with Proto definition

2016-11-16 Thread Bojan D
{ "foo": "bar", "active": true } }, "j...@gmail.com": { "email": "j...@gmail.com", "firstName": "Jane", "lastName": "Smith" } } function main() { const u = new User(dat

Re: [protobuf] How to represent variable JSON object data with Proto definition

2016-11-17 Thread Bojan D
metadata field needs to > contain? Does it really need to support completely arbitrary JSON or would > it possibly be something where there are just a handful of different basic > schemas you expect? If the field can be arbitrary JSON then perhaps the > best solution would be to ju