awakesecurity / proto3-suite

Haskell Protobuf Implementation
https://hackage.haskell.org/package/proto3-suite
Other
80 stars 55 forks source link

Need to lowerCamelCase JSONPB key names #206

Open j6carey opened 2 years ago

j6carey commented 2 years ago

According to the protobuf v3 specification:

Message field names are mapped to lowerCamelCase and become JSON object keys. If the json_name field option is specified, the specified value will be used as the key instead. Parsers accept both the lowerCamelCase name (or the one specified by the json_name option) and the original proto field name.

Current compile-proto-file keeps the original field name.

Note that testCase13 in tests/SimpleDecodeDotProto.hs would be able to decode from the JSONPB format emitted by Python if we were to add support for parsing lowerCamelCase conversions of field names.