flowup / api-client-generator

Angular REST API client generator from Swagger YAML or JSON file with camel case settigs
MIT License
115 stars 21 forks source link

Support responseType in HttpOptions #77

Closed MuraliNunna closed 5 years ago

MuraliNunna commented 5 years ago

Hi,

For endpoints serving file downloads, HttpOptions need to support responseType. The current generated code doesn't support this.

I dug around the issues, and found that it was actually removed here at https://github.com/flowup/api-client-generator/commit/74c53a4570b8fba0dcd1f83957b35fd53ffb3c46

I had to manually change the generated code to

export interface HttpOptions {
  headers?: HttpHeaders;
  params?: HttpParams;
  reportProgress?: boolean;
  withCredentials?: boolean;
  responseType?: any;
}

to support the endpoint

Any ideas?

vmasek commented 5 years ago

Thanks for a report, it was removed due to some issues we had with that, I'll have a look at it during the week.

Is it only responseType that you need? Does adding it into HttpOptions solve your problem?

MuraliNunna commented 5 years ago

Yes, adding the responseType to HttpOptions solves the issue.