The object keys used in generated 'toObject' methods are not consistent
with field names.
message ExampleMessage {
repeated OtherMessage *identifier *= 1;
}
The generated js toObject function produces an object with this form:
{ *identifierList *: [...] }
JSON parsing utilities (for example JsonFormat.parser().merge) expect
something of this form:
{ *identifier *: [...] }
Superficially, the existing behavior may seem correct because key name is
consistent with the generated js accessor function. I would argue that
this behavior is wrong. Proto accessor functions vary significantly from
language to language. JSON (like proto) is actually a language-independent
format. It makes much more sense to have a single cannonical
language-independent JSON representation for proto objects.
--
You received this message because you are subscribed to the Google Groups
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.