Skip to content

When using parseAs the return type is type wrongly. #3835

@ShanSenanayake

Description

@ShanSenanayake

Description

Description

The generated client allows overriding parseAs at runtime via endpoint options, but the generated TypeScript signatures still assume the data is returned normally.

Basically if you use parseAs: "blob" it still returns the regular data typing and not the data as a blob.

Because options is spread after the default, responseStyle: 'fields' works at runtime. But the return type is still hardcoded to 'data'.

Expected behavior

If a caller passes parseAs: "blob" the returned data should be of type 'blob'

Reproducible example or configuration

https://stackblitz.com/edit/hey-api-client-fetch-example

OpenAPI specification (optional)

No response

System information (optional)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug 🔥Broken or incorrect behavior.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions