Skip to content

Commit

Permalink
proto-loader: declare oneof fields as optional
Browse files Browse the repository at this point in the history
  • Loading branch information
murgatroid99 committed Feb 28, 2025
1 parent 46a5e51 commit 7d39d52
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/proto-loader/bin/proto-loader-gen-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ function generateRestrictedMessageInterface(formatter: TextFormatter, messageTyp
if (options.includeComments) {
formatComment(formatter, oneof.comment, oneof.options);
}
formatter.writeLine(`'${oneof.name}': ${typeString};`);
formatter.writeLine(`'${oneof.name}'?: ${typeString};`);
}
}
if (options.outputBranded) {
Expand Down

0 comments on commit 7d39d52

Please sign in to comment.