-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
jsonpb doesn't decode proto3 string enums #59
Comments
In the (unpublished) spec, only the symbolic names are supported, but we should definitely permit round-tripping what we can produce. |
I believe this is still happening for repeated enum fields. |
Can you please file a new issue for that, preferably with a reproduction case? |
Will do. I think I can spend some time on a fix, too. |
FYI, I've opened #163 to fix the repeated enum thing. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Using the jsonpb package, I can marshal a proto3 message to JSON with enums as strings.
However, I cannot go in the reverse direction. The Unmarshal function returns an error when I try to unmarshal JSON with string enums.
I expected this to work how it does with proto2 messages.
Failing round-trip example here:
This code panics with
json: cannot unmarshal string into Go value of type proto3_proto.Message_Humour
.The text was updated successfully, but these errors were encountered: