Oneof toObject loses case

未关闭
#33 4 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
javascript
领域
api

调研方向

从 protoc-grpc-web 生成的类及其 toObject() 转换开始,并以 issue #675 中描述的行为作为复现参考。完成的标准是,普通对象只包含活动 oneof 情况下定义的属性,而不是为每种情况都包含具有默认值的属性。

由索引模型根据 Issue 内容生成。

描述

bug javascript port-fix triaged

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

主要语言
JavaScript
星标
471
派生
91
平均合并
3 小时 57 分钟
30 天内合并 PR
2

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

protocolbuffers/protobuf-javascript 的其他 Issue

查看 protocolbuffers/protobuf-javascript 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。