-
Notifications
You must be signed in to change notification settings - Fork 48
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
support oneof values #10
Comments
No you found a missing feature. Well done :) |
I am on holiday, but I'll be back next week. |
I'm working on a solution. |
sorry about the code quality. I would really appreciate a pull request, but
|
Not at all. It will require some kind of workarround because json can't be directly marshalled onto protobuf onof fields. |
proto3 supports json as one of its serialization formats and proto3 has oneof, so we should check how the jsonpb package serializes oneof fields. It is some of the hackiest code I have written in a while. Also one of my first projects with a significant amount of javascript. Luckily the user doesn't have to write the code so we are also using letmgerpc for about 4 guis at the moment. oneof would be a great additional feature. |
Any status update on this @GeertJohan ? Anything I can help with? |
@awalterschulze gogoproto /letmegrpc are both great and I'm really enjoying them. Hey, I happened to hit this very bug in my project, and came to this bug report. |
There is no progress on this, but a contribution would be more than welcome. |
I don't know, why don't just use jsonpb for Unmarshal it? |
I think a lot of this was made just before jsonpb became popular. |
It looks like oneof is not supported. The JSON doesn't seem to be marshalled onto the oneof structure correctly. The oneof is ofcourse defined as interface field using the is_ type.
Maybe there's a custom unmarshal function required, or a different work arround (sending the oneof type and value as seperate json?
The text was updated successfully, but these errors were encountered: