enum values should have `json_name` pseudo-option just like fields
Fields can be renamed, even when using JSON format, by setting json_name and ensuring that it never changes. This allows the field's name to change without impacting how it is serialized to/de-serialized from JSON.
Since enum values are also identified by name in the JSON format, they should have an analogous feature: a json_name pseudo-option, allowing the enum value's actual name to change while its JSON encoding remains the same.
I call the existing field json_name a "pseudo-option" because, though it uses the option syntax in proto source, it does not end up in the google.descriptor.FieldOptions message. Instead, it is promoted to a field of google.descriptor.FieldDescriptorProto. For symmetry, I would expect the enum value option to behave similarly, resulting in a new json_name field on google.descriptor.EnumValueDescriptorProto.
We triage inactive PRs and issues in order to make it easier to find active work. If this issue should remain active or becomes active again, please add a comment.
This issue is labeled inactive because the last activity was over 90 days ago.
This is still relevant, can someone add the necessary labels so the bot won't come back here?
I'm willing to bite the bullet on this, but I'd need some insights and discussion before putting a PR. Would you be available to share some context, @mkruskal-google ?
We triage inactive PRs and issues in order to make it easier to find active work. If this issue should remain active or becomes active again, please add a comment.
This issue is labeled inactive because the last activity was over 90 days ago. This issue will be closed and archived after 14 additional days without activity.
Active
Any updates on this? Right now there's some incompatibility between proto convention through transcoding and graphql schema that forces you to match either side with the other for a consistent output, since the prefix is only a protobuf thing I think this feature would be a huge help.
I ran into this limitation today. I think it would be really useful.
HOw is this not a thing :D So many APIs all over use string values for enums (correctly or incorrectly)
It would save so much pain and boilerplate code for custom conversions, how was not it handled it.
I just ran into this issue myself, would be happy to help implement this in any way I can.
We triage inactive PRs and issues in order to make it easier to find active work. If this issue should remain active or becomes active again, please add a comment.
This issue is labeled inactive because the last activity was over 90 days ago. This issue will be closed and archived after 14 additional days without activity.
This is still a pain point.
Note: this is a useless comment to satiate the stalebot inactivity overlords
I would love this kind of annotation