cyclosproject / ng-openapi-gen

An OpenAPI 3.0 codegen for Angular
MIT License
397 stars 132 forks source link

Blob response should not be typed like a json #331

Open Xample opened 1 week ago

Xample commented 1 week ago

Hello, unlike json request which should be typed properly, the "blob" responseType should have a "Blob" resultType.

the resultType must be "Blob" (PascalCase) if the responseType is a "blob" (lowercase).

I can imagine this possible 2 lines fix:

  this.responseType = this.inferResponseType(successResponse, operation, options);
  this.resultType = this.responseType === "blob" ? "Blob" : successResponse.type;