proto-loader: declare oneof fields as optional

This commit is contained in:
Michael Lumish 2025-02-28 14:31:45 -08:00
parent 46a5e517ec
commit 7d39d52b77
1 changed files with 1 additions and 1 deletions

View File

@ -398,7 +398,7 @@ function generateRestrictedMessageInterface(formatter: TextFormatter, messageTyp
if (options.includeComments) { if (options.includeComments) {
formatComment(formatter, oneof.comment, oneof.options); formatComment(formatter, oneof.comment, oneof.options);
} }
formatter.writeLine(`'${oneof.name}': ${typeString};`); formatter.writeLine(`'${oneof.name}'?: ${typeString};`);
} }
} }
if (options.outputBranded) { if (options.outputBranded) {