Skip to content

fix: Omit proto3 synthetic oneofs in toObject#2273

Merged
dcodeIO merged 1 commit into
masterfrom
patch/optional-oneof
May 21, 2026
Merged

fix: Omit proto3 synthetic oneofs in toObject#2273
dcodeIO merged 1 commit into
masterfrom
patch/optional-oneof

Conversation

@dcodeIO

@dcodeIO dcodeIO commented May 20, 2026

Copy link
Copy Markdown
Member

Proto3 optional fields are represented internally using synthetic oneofs for descriptor/reflection compatibility (see #1584), but these should not appear as user-facing oneof discriminators. This change omits synthetic proto3 optional oneofs in toObject(..., { oneofs: true }).

Fixes #2037
Related: grpc/grpc-node#2754

@dcodeIO dcodeIO requested a review from alexander-fenster May 20, 2026 22:52
@dcodeIO dcodeIO merged commit 9a78a4a into master May 21, 2026
5 checks passed
@github-actions github-actions Bot mentioned this pull request May 21, 2026
@dcodeIO dcodeIO deleted the patch/optional-oneof branch May 30, 2026 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A message type's toObject function includes extra underscore-prefixed fields when the oneofs option is set

2 participants