question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support for `optional` in proto3

See original GitHub issue

Calling protoc with --experimental_allow_proto3_optional returns

filename.proto is a proto3 file that contains optional fields, but code generator protoc-gen-ts hasn’t been updated to support optional fields in proto3. Please ask the owner of this code generator to support proto3 optional.

For more information on implementation, see: https://github.com/protocolbuffers/protobuf/blob/master/docs/implementing_proto3_presence.md

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

6reactions
thesayyncommented, Apr 21, 2021

Hey, @sky-lake. We have landed a new release candidate for this https://www.npmjs.com/package/protoc-gen-ts/v/0.3.6-rc2 Let me know if it works for you 🤓

Also, please consider supporting me in any way you could.

1reaction
antiqecommented, May 22, 2021

@thesayyn Thanks a lot strongly appreciate your work 🥇

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to define an optional field in protobuf 3 - Stack Overflow
Since protobuf release 3.15, proto3 supports using the optional keyword (just as in proto2) to give a scalar field presence information.
Read more >
Is optional field officially supported in proto3? #10463 - GitHub
Based on a few references, my guess is that the entire purpose of optional in Proto3 is to tell ProtoC to generate the...
Read more >
Language Guide | Protocol Buffers - Google Developers
Move optional fields into or out of a oneof: You may lose some of your information (some fields will be cleared) after the...
Read more >
Optional fields - Embedded Proto
As of Google Protobuf version 3.15, optional fields are reintroduced in proto3. Embedded Proto supports optional fields as of version 2.3.0.
Read more >
Protobuf 3 optional vs FieldMasks - Google Groups
I think you are right that FieldMasks predate proto3 optional fields and were originally designed to accommodate the lack of optional fields in ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found