Protobuf: jsonpb convert underscores to camelcase, that is not what i wanted.

Created on 14 Jun 2016  路  3Comments  路  Source: golang/protobuf

Jsonpb convert underscores to camelcase, that is not what i wanted. for example:

{"ttt_aaa":"fdasfdsa"}

After UnmarshalNext and Unmarshal,the result is like this:

{"tttAaa":"fdasfdsa"}

Is it have a way to output like this? Thanks.

{"ttt_aaa":"fdasfdsa"}

Most helpful comment

If you set Marshaler.OrigName to true, then Marshal will work as you want.

All 3 comments

If you set Marshaler.OrigName to true, then Marshal will work as you want.

@zombiezen Thanks~

If you set Marshaler.OrigName to true, then Marshal will work as you want.

THANK YOU!! YOU SAVED MY LIFE

Was this page helpful?
0 / 5 - 0 ratings