-
Notifications
You must be signed in to change notification settings - Fork 25
Open
Description
Description
Every field in protobuf is technically optional; if a field isn't supplied it's given the zero value.
The generated typescript types for scalars are marked as "required" according to typescript, even though you can send a message with the value missing, because of how proto actually works.
This mismatch is kind of frustrating when a user doesn't actually care about one of our optional_ fields.
One way to solve this would be to use proto3 optional annotations in the upstream; this may meaningfully change the semantics of the API. Another potential way to solve it would be wrapping or whacking the Typescript types.
The basic reason for this is that Typescript cares about presence and absence, where proto doesn't by default.
Metadata
Metadata
Assignees
Labels
No labels