Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Cannot serialize object when key has underline #20

yyfrankyy opened this Issue · 6 comments

4 participants

Frank Xu Adam Magaluk Nikolai Vavilov Chris Dew
Frank Xu

Key hello_world in js object need to be changed to helloWorld. weird..

But what if I have another key named helloWorld ?

message {
  required string hello_world = 1;
  required string helloWorld = 2;
Adam Magaluk

Having the same issue on protobuf v0.8.6. Any key with an underscore does not get serialized.

Adam Magaluk

Submitted pull request to fix this issue. #21

Adam Magaluk

Currently the default functionality is to convert all assessors to camel case. "hello_world" would then be accessed by "helloWorld".

Nikolai Vavilov

Using underscore separated names for field names in the convention in protobuf. If your schema defines hello_world and helloWorld in the same message, then you should complain to the author of the schema, because it will break the official Java implementation as well.

Frank Xu

@seishun If it broke the official java implementation as well, then that's a problem. Language compatibility is one of the features that protobuf provides, as I known so far, cpp, ruby, python implementations are ok with this.

Chris Dew

I'm closing this, as there's been no activity, and @seishun is right.

Chris Dew chrisdew closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.