[protobuf] Re: Descriptor for ProtoBuf Messages in Javascript.

2018-02-12 Thread Yaseen Khan
So, could you possibly give me the work around for it? It would be very helpful. Thanks! On Friday, 9 February 2018 17:06:45 UTC+5:30, Yaseen Khan wrote: > > I'm trying to get the descriptor for my proto message. In java there is > this, Message.getDescriptor() > which does the job but its hard

Re: [protobuf] Re: Descriptor for ProtoBuf Messages in Javascript.

2018-02-13 Thread 'Adam Cozzette' via Protocol Buffers
What do you want to do with the descriptors? On Mon, Feb 12, 2018 at 10:15 PM, Yaseen Khan wrote: > So, could you possibly give me the work around for it? It would be very > helpful. Thanks! > > On Friday, 9 February 2018 17:06:45 UTC+5:30, Yaseen Khan wrote: >> >> I'm trying to get the descript

Re: [protobuf] Re: Descriptor for ProtoBuf Messages in Javascript.

2018-02-13 Thread Yaseen Khan
Trying to create dynamic forms by reading proto msgs. On 13-Feb-2018 22:48, "Adam Cozzette" wrote: > What do you want to do with the descriptors? > > On Mon, Feb 12, 2018 at 10:15 PM, Yaseen Khan > wrote: > >> So, could you possibly give me the work around for it? It would be very >> helpful. T

Re: [protobuf] Re: Descriptor for ProtoBuf Messages in Javascript.

2018-02-13 Thread 'Adam Cozzette' via Protocol Buffers
But ordinarily you parse messages without needing any descriptors--why do need a descriptor to read your message? On Tue, Feb 13, 2018 at 9:20 AM, Yaseen Khan wrote: > Trying to create dynamic forms by reading proto msgs. > > On 13-Feb-2018 22:48, "Adam Cozzette" wrote: > >> What do you want to

Re: [protobuf] Re: Descriptor for ProtoBuf Messages in Javascript.

2018-02-13 Thread Yaseen Khan
A dynamic form needs keys and values(if any) to be fed to it to create a form. I was thinking I could get the names of the properties in a msg with a descriptor and feeding it to create a dynamic form. Although a crude way of doing it is converting the jspb proto object to a normal Object and read

Re: [protobuf] Re: Descriptor for ProtoBuf Messages in Javascript.

2018-02-13 Thread 'Adam Cozzette' via Protocol Buffers
Ah, I see. I would try to find a way to do this without trying to rely on reflection, perhaps by serializing the names you need inside a proto message without using the actual field names. On Tue, Feb 13, 2018 at 9:28 AM, Yaseen Khan wrote: > A dynamic form needs keys and values(if any) to be fe

Re: [protobuf] Re: Descriptor for ProtoBuf Messages in Javascript.

2018-02-13 Thread Yaseen Khan
I'm sorry I don't understand. How would you serialise the field names? On 13-Feb-2018 23:32, "Adam Cozzette" wrote: > Ah, I see. I would try to find a way to do this without trying to rely on > reflection, perhaps by serializing the names you need inside a proto > message without using the actua

Re: [protobuf] Re: Descriptor for ProtoBuf Messages in Javascript.

2018-02-13 Thread 'Adam Cozzette' via Protocol Buffers
I mean to say just don't rely on the field names at all, and instead store all the information you need in the serialized message. For example, your serialized message could store a map that maps the string property name to another message called DataType describing the kind of data associated with

Re: [protobuf] Re: Descriptor for ProtoBuf Messages in Javascript.

2018-02-13 Thread Yaseen Khan
But a single message can have various data types as seen in the example.. The message Master {..} On 13-Feb-2018 23:41, "Adam Cozzette" wrote: I mean to say just don't rely on the field names at all, and instead store all the information you need in the serialized message. For example, your seri

Re: [protobuf] Re: Descriptor for ProtoBuf Messages in Javascript.

2018-02-13 Thread 'Adam Cozzette' via Protocol Buffers
Oneof fields are great for representing that, though: https://developers.google.com/protocol-buffers/docs/proto#oneof On Tue, Feb 13, 2018 at 10:15 AM, Yaseen Khan wrote: > But a single message can have various data types as seen in the example.. > The message Master {..} > > On 13-Feb-2018 23:4

Re: [protobuf] Re: Descriptor for ProtoBuf Messages in Javascript.

2018-02-13 Thread Yaseen Khan
But that oneof says, only one field should be set at a time , and in my example I need all of my fields to be set. On 13-Feb-2018 23:49, "Adam Cozzette" wrote: > Oneof fields are great for representing that, though: https://developers. > google.com/protocol-buffers/docs/proto#oneof > > On Tue, F