You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Having the same problem, just came here to gently bump the thread. :-)
Additional testing also revealed that if I load the proto files directly with grpc-loader[1], then the dynamically generated JS code has the correct (camel) casing.
My suggestion: the default behavior should match the style guide (which calls for snake_case in field names, and CamelCase for the proto name), and have a flag to enable the extension (or extensions).
If the flag's not set, this could emit a warning on seeing a CamelCase field name.
P.S. I'm willing to take on this patch once we have agreement on how it should work.
Activity
k10-patil commentedon Jun 17, 2021
any updates on this? facing same issue. It would be nightmare to edit fieldnames when dealing with large number of proto messages!
petermetz commentedon Aug 11, 2021
Having the same problem, just came here to gently bump the thread. :-)
Additional testing also revealed that if I load the proto files directly with grpc-loader[1], then the dynamically generated JS code has the correct (camel) casing.
[1]:
trent1000 commentedon Aug 11, 2021
feat(cmd-api-server): support grpc web services hyperledger-cacti#1189
feat(cmd-api-server): support grpc web services hyperledger-cacti#1189
youurayy commentedon Aug 28, 2021
This is an absolute deal-breaker of using google-protobuf in javascript.
thesayyn commentedon Dec 8, 2021
I don’t think that google will change this behaviour anytime soon.
also seen on #37
dibenede commentedon Sep 2, 2022
This is fixable and is inconsistent with other proto runtimes. However, it poses a compatibility problem. The issue is here:
protobuf-javascript/generator/js_generator.cc
Line 290 in a428c58
The immediate workaround is to use underscore_naming style rather than camelCase.
The fix would be to flag gate the naming behavior. We'll need to consider which direction the flagging should operate.
sarahec commentedon Oct 23, 2022
My suggestion: the default behavior should match the style guide (which calls for snake_case in field names, and CamelCase for the proto name), and have a flag to enable the extension (or extensions).
If the flag's not set, this could emit a warning on seeing a CamelCase field name.
P.S. I'm willing to take on this patch once we have agreement on how it should work.
Change field names to lower_snake_case
Change field names to lower_snake_case
WebUI: Change field names to lower_snake_case
jmzwcn commentedon Oct 25, 2023
https://protobuf.dev/programming-guides/style/#message-field-names