Skip to content

Incorrect Response Types #539

@blankform

Description

@blankform

Any idea why the response types are different from the typescript types generated from protobufs?

According to the typescript bindings, I'm supposed to be receiving a response like:

{ 
  results: IResult[]
  total_size: number
  next_page_token: ...
}

but at runtime, the response is actually:

// IResult[]
[
  {
     text: "someStringValue",
     someField: "someStringValue"
  },
  { 
     text: "someStringValue",
     someField: "someStringValue"
  }, ...
]

Seems like there's some autopagination destructuring going on, which is honestly great, but the type mismatch makes it very leaky to use.

Also if there's a number | null type, runtime will actually have a string. Wondering if I missed some JSON parsing step here?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions