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

Enum type -> String value #1111

Closed
bordunosp opened this issue Feb 21, 2021 · 5 comments
Closed

Enum type -> String value #1111

bordunosp opened this issue Feb 21, 2021 · 5 comments

Comments

@bordunosp
Copy link

Hi
I need string value of enum type
How I can get it?

Now var "name" is internal, so I cant use it and no other way got it.

I found many similar issue, but no one can help me
each person should be able to independently decide how to organize their code

Earlier I worked with GRPC used python, C#, Go.
All this lang have both ways Int vs String.
Why Swift decides for me?

@thomasvl
Copy link
Collaborator

See the other open & closed issues for this. The other languages tend to expose this via their "reflection" apis where they expose descriptor objects that let you interact with messages/fields/enums generically. This library doesn't yet provide anything like that.

Some of the open issues related to this and enums: #872 #731

@bordunosp
Copy link
Author

just change "internal" to "public" its easy (:

@bordunosp
Copy link
Author

Databases didn't just come up with a type like enum. Try make alters to tables that are over hundreds of millions of records just to change the enum to smallint so-so, it's easier to take another grpc tool.

It doesn't matter anymore. There are too many problems with other libraries when working on Linux. Swift is definitely a good tool, but apparently it's too early... mb after few years...

@sweetbot
Copy link

Any update on this? For analytics purpose we need to log the enum name. Protobuf for most other languages have an API to get the String from enum.

@elye
Copy link

elye commented Mar 20, 2022

I can easily do this in Android, but not in iOS. The inability to get the String from the enum make sharing the same Protobuf usage across the two platforms is limited.

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

4 participants