Oneof toObject loses case
What version of protobuf and what language are you using? Version: master/v3.6.0/v3.5.0 etc. Language: Javascript
What operating system Linux, Windows and version?
What runtime / compiler are you using (e.g., python version or gcc version)
What did you do? Steps to reproduce the behavior: generated classes and methods via protoc-grpc-web result in oneof losing its case when converted to a plain object by toObject() See https://github.com/grpc/grpc-web/issues/675 for details
What did you expect to see The result object to only have one defined property for the oneof case
What did you see instead? All of the oneof cases are generated in the result plain object with their type default values
Make sure you include information that can help us debug (full error message, exception listing, stack trace, logs).
Anything else we should know about your project / environment
Any update? I have encountered a similar problem.
In the toObject gencode we print out default values for members that are not set. We should instead print undefined.
Does the above solution include in the new version?
Sorry, we haven't fixed this yet.