-
Notifications
You must be signed in to change notification settings - Fork 25
Closed
Labels
need/analysisNeeds further analysis before proceedingNeeds further analysis before proceedingneed/maintainer-inputNeeds input from the current maintainer(s)Needs input from the current maintainer(s)released
Description
Expected
As per proto3
's language guide:
Message fields can be one of the following:
- singular: a well-formed message can have zero or one of this field (but not more than one). And this is the default field rule for proto3 syntax.
Hence, I would expect the TypeScript code to allow singular fields to be undefined
syntax = "proto3";
message Message {
bytes payload = 1;
}
should generate
export interface Message {
payload?: Uint8Array
}
Actual
syntax = "proto3";
message Message {
bytes payload = 1;
}
generates
export interface Message {
payload: Uint8Array
}
Note
When using the optional
keyword, I can get the desired effect:
message Message {
optional bytes payload = 1;
}
export interface Message {
payload?: Uint8Array
}
However, optional
is not part of the proto3
syntax.
Metadata
Metadata
Assignees
Labels
need/analysisNeeds further analysis before proceedingNeeds further analysis before proceedingneed/maintainer-inputNeeds input from the current maintainer(s)Needs input from the current maintainer(s)released