Skip to content

[Typescript-Anuglar] responseType not set on string response #8399

Description

@iljab
Description

If response is a string, i get the following error when consuming the generated service:

Http failure during parsing for {API_URL}

Generated service:

return this.httpClient.get<string>(`${this.basePath}/accounts/${encodeURIComponent(String(accountName))}/account_name`,
            {
                withCredentials: this.configuration.withCredentials,
                headers: headers,
                observe: observe,
                reportProgress: reportProgress
            }
        );

If i add the line responseType: 'text' as 'json' to the options, everything works as expected.

Swagger-codegen version

2.3.1
2.4.0

Swagger declaration file content or url
"responses": {
"200": {
"description": "Returns account name for id",
"schema": {
"type": "string"
}
}
}

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