Skip to content

Blob responsetype error #93

@KnutHaraldR

Description

@KnutHaraldR

I have a method that expects type blob. Intead what's generated is this

exportvalues(params: ExportvaluesParams): Observable<blob> {
    const pathParams = {
      id: params.id,
    };
    return this.http.get<blob>(`/api/dimensions/${pathParams.id}/exportvalues`);
  }

Which gives the error that blob don't exist.

Here is an example correct implementation:

GetExportValuesResponse(id: number): __Observable<__StrictHttpResponse<any>> {
    let __params = this.newParams();
    let __headers = new HttpHeaders();
    let __body: any = null;

    let req = new HttpRequest<any>(
      'GET',
      this.rootUrl + `/api/dimensions/${id}/exportvalues`,
      __body,
      {
        headers: __headers,
        params: __params,
        responseType: 'blob'
      });

    return this.http.request<any>(req).pipe(
      __filter(_r => _r instanceof HttpResponse),
      __map((_r) => {
        return _r as __StrictHttpResponse<any>;
      })
    );
  }

TL;DR: Use <any> and responseType: 'blob'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions