Closed ddddwx closed 5 months ago
It should be"project_id"as same as definition in .proto
Can you elaborate why it should be? It isn't with Protobuf for Go, Java, C#, PHP, or Dart.
It should be"project_id"as same as definition in .proto
Can you elaborate why it should be? It isn't with Protobuf for Go, Java, C#, PHP, or Dart.
This is how proto is defined. I need to unify to have proper front-end and back-end communication. Is "lower snake case" configurable? I didn't see the relevant configuration in the instruction manual.
If I use projectId, there is a server-error, projectId cannot be identified by server.
This is not how Protobuf is typically implemented - see the list of implementations above. Instead, the goal is to provide an API that is idiomatic to the target language. Peers can properly communicate regardless of property casing.
There is no plugin option to change the behavior.
I think @timostamm is getting his repos mixed up :) There is an option for this, see use_proto_field_name
:
By default interface fields use lowerCamelCase names by transforming proto field names to follow common style convention for TypeScript. Set this option to preserve original proto field names in generated interfaces.
Oof, I completely forgot about it 😅 Thanks for the shout, @jcready.
I think @timostamm is getting his repos mixed up :) There is an option for this, see
use_proto_field_name
:By default interface fields use lowerCamelCase names by transforming proto field names to follow common style convention for TypeScript. Set this option to preserve original proto field names in generated interfaces.
wow!!! It works!! Thank you very much for your help and detailed explanation. @jcready
Oof, I completely forgot about it 😅 Thanks for the shout, @jcready.
Thank you for providing this protoc tool. It's incredibly concise and user-friendly. I'm extremely grateful for it! Thank you once again! @timostamm
This is my .proto:
I run the command:
npx protoc --ts_out src/grpc/gen --ts_opt client_generic --proto_path src/grpc/proto src/grpc/proto/configuration_platform.proto
But I get the interface definition:
It should be
"project_id"
as same as definition in .proto How could I fix my protoc command? Many thanks.