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 option to print enums as ints in Ruby JSON encoder #6384
Conversation
Please send changes of upb to https://github.com/protocolbuffers/upb first. |
Any update? |
There is some ongoing work to update upb in ruby: #5866 Please send change to upb first. Once you are done, we probably have updated the upb in ruby. |
We have update upb in ruby. Could you try again? |
@spiffyyeng I'm going to close this since there has been no activity in a long time, but feel free to comment here if you would still like to pursue this change. |
I'd personally love to see it, but don't know the internals enough yet to attempt it myself. |
This would be an easy change. We already support two options to the JSON encoder: protobuf/ruby/ext/google/protobuf_c/message.c Lines 1146 to 1155 in 7309e88
We would just need to add support for the |
Fixes #6178
Adds the option to print enums as int values instead of the default strings for Ruby (similar to the option present for C++).
Example:
test.proto
code.rb
will output: