You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What language does this apply to? Ruby
If it's a proto syntax change, is it for proto2 or proto3? NA
If it's about generated code change, what programming language? Ruby
Describe the problem you are trying to solve.
When used ruby code generated from a protobuf with an enum definition, the enum field is not type-safe because enum values are handled as symbols or integers.
Describe the solution you'd like
Sorbet is a fast, powerful type checker designed for Ruby that is used in my project. I would like to be able to automatically generate an instance of the Sorbet typed enum class whose fields would match those defined in the protobuf. This would allow the enum field to be strictly typed, rather than a symbol or integer.
Describe alternatives you've considered
The alternative is to not have type safety on enum fields and instead continue passing them as symbols. This works fine, but having the guardrail of type-safety would still be preferred.
What language does this apply to? Ruby
If it's a proto syntax change, is it for proto2 or proto3? NA
If it's about generated code change, what programming language? Ruby
Describe the problem you are trying to solve.
When used ruby code generated from a protobuf with an enum definition, the enum field is not type-safe because enum values are handled as symbols or integers.
Describe the solution you'd like
Sorbet is a fast, powerful type checker designed for Ruby that is used in my project. I would like to be able to automatically generate an instance of the Sorbet typed enum class whose fields would match those defined in the protobuf. This would allow the enum field to be strictly typed, rather than a symbol or integer.
Describe alternatives you've considered
The alternative is to not have type safety on enum fields and instead continue passing them as symbols. This works fine, but having the guardrail of type-safety would still be preferred.
Additional context
Protobuf Ruby generated code docs
Sorbet Enums
The text was updated successfully, but these errors were encountered: