-
Notifications
You must be signed in to change notification settings - Fork 811
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
Allow set jsontag and moretags for oneof #623
Comments
I would like this as well! The protoc-gen-gotag package has this feature, and have solved it like this: The option has a tag, which adds that tag to both types.
The generated code looks like this:
And the option is added like this..
|
Would a PR implementing this be welcome? |
+1 on this. Is this a valid feature for gogo protobuf? 🤗 |
Our use case is that we map from
This is does not work with just json tags. ): cc @s-urbaniak Wonder if we can workaround with custom unmarshal/marshal 🤔 |
I would say now that workaround is actually the long term solution as well. This is because for our case we depend on special type field that tells the type of oneof in JSON. This is how it looks if anyone is interested:
|
Hi,
What do you think about setting tags for oneof directly? Syntax might look like:
Then you gain have full control of the generated message tags. I found this as a limitation in my use-case.
The text was updated successfully, but these errors were encountered: