Use camelCase in enums inside messages #671
Answered
by
stephenh
netanel-utila
asked this question in
Q&A
-
Given the following code:
It'll generate the following TS: export const User_Status = { STATUS_UNSPECIFIED: 0, STATUS_PENDING: 1, STATUS_ACTIVE: 2 } as const; Is there anyway to convert it to |
Beta Was this translation helpful? Give feedback.
Answered by
stephenh
Sep 6, 2022
Replies: 1 comment 1 reply
-
No, because of the concern with naming conflicts, i.e. if there was a message called Granted, this is unlikely, but in the huge/wide array of schemas that people use ts-proto for, "anything can happen". We could potentially try and probe "does message UserStatus" actually exist, and if it does not, then do not use the If you wanted to try a PR that did that, that'd be great. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
netanel-utila
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
No, because of the concern with naming conflicts, i.e. if there was a message called
message UserStatus
.Granted, this is unlikely, but in the huge/wide array of schemas that people use ts-proto for, "anything can happen".
We could potentially try and probe "does message UserStatus" actually exist, and if it does not, then do not use the
_
delimited name...If you wanted to try a PR that did that, that'd be great.