Closed ai2soft closed 3 years ago
In the proto file, set the field name of a message to e.g. session_expired
instead of SessionExpired
then the generated code contains getSessionExpired()
and setSessionExpired()
. I assume that this is a relict from the early days of protobuf for JS to keep backward compatibility.
It's indeed annoying, especially if you use the proto file for other languages like C# as well because there the field name SessionExpired
results (as expected) in a property SessionExpired
.
hi, thanks for reply. i build a C# project to rewrite the field names . as you mentioned, i use C# at the same time.
发件人: renkei @.> 发送时间: 2021年9月23日 4:58 收件人: grpc/grpc-web @.> 抄送: jin li Zhang @.>; Author @.> 主题: Re: [grpc/grpc-web] is it possible to keep message field name unchange while generate _pb.js files ? (#1133)
In the proto file, set the field name of a message to e.g. session_expired instead of SessionExpired then the generated code contains getSessionExpired() and setSessionExpired. I assume that this is a relict from the early days of protobuf for JS to keep backward compatibility.
It's indeed annoying, especially if you use the proto file for other languages like C# as well because there the field name SessionExpired results (as expected) in a property SessionResult.
― You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/grpc/grpc-web/issues/1133#issuecomment-925324558, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AUBCPWINQEXHE5ZTNQBWY63UDI7NZANCNFSM5DO4YLVQ. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
Hi guys , i defineded some messages
as you can see, the message's fields are well formatted. but , when i generated the files of XXXX_pb.js by command
--grpc-web_out=import_style=commonjs,mode=grpcwebtext:.
the target names were changed to get{[A-Z]}{[a-z]+} like. likes:
why it should be like that ? can it be kept unchanged? likes :