Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support in stringEnums #34

Open
mottiyudkin opened this issue Nov 28, 2022 · 0 comments
Open

Add support in stringEnums #34

mottiyudkin opened this issue Nov 28, 2022 · 0 comments

Comments

@mottiyudkin
Copy link

Feature Request

Add support in stringEnums

Is your feature request related to a problem? Please describe.

The generated values in the enums are numbers, but when we are working with enums: String we need to adapt each enum from int to string, it looks something like this

enum CarsFromProto {
  Audi = 1
}

enum Cars {
  Audi = "Audi"
}

Describe the solution you'd like

Add option to generate the enums with string values instead int values.
You can check how it's can be done in other libraries like ts-proto
With --ts_proto_opt=stringEnums=true, the generated enum types will be string-based instead of int-based.

What is the motivation / use case for changing the behavior?

Adding support for all users that want to use string enums

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant