Skip to content

oneof produces type with required fields #280

Open
@ron23

Description

@ron23

proto3: when using oneof I expect to get a union of the various options. Right now all the fields are required.

// proto
message ABC {
  oneof something {
    string a = 1;
    string b = 2;
  }
// generated
export namespace ABC {
  export type AsObject = {
    a: string,
    b: string,
  }

I expected to get something like:

export namespace ABC {
    type A = {  a: string };
    type B = {  b: string };
    
    export type AsObject = A | B

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions