blockscout / actix-prost

Actix route generator for gRPC server
MIT License
5 stars 1 forks source link

Field renaming #31

Open bragov4ik opened 1 week ago

bragov4ik commented 1 week ago

It seems that in generated HTTP server, fields of messages are renamed to camel case. Is this a feature?

leviska commented 1 week ago

Basically that's the specification

https://protobuf.dev/programming-guides/proto3/#json

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

While parsers should accept both, most libraries (for other languages) output lowerCamelCase as a default, so we decided to use that