title: nswag generated client with wrong response type
body: <p>This is autogenerated Angular service file from C# controller with help of nswag swagger client generation. This below code has all the services. In component i am trying to call getCompanyInfoOption() api. But i am not getting response data that i am sending from controller.</p>
  
  <pre><code>/* tslint:disable */
  /* eslint-disable */
  //----------------------
  // &lt;auto-generated&gt;
  //     Generated using the NSwag toolchain v13.6.0.0 (NJsonSchema v10.1.18.0 (Newtonsoft.Json v12.0.0.0)) (http://NSwag.org)
  // &lt;/auto-generated&gt;
  //----------------------
  // ReSharper disable InconsistentNaming
  
  import { mergeMap as _observableMergeMap, catchError as _observableCatch } from 'rxjs/operators';
  import { Observable, throwError as _observableThrow, of as _observableOf } from 'rxjs';
  import { Injectable, Inject, Optional, InjectionToken } from '@angular/core';
  import { HttpClient, HttpHeaders, HttpResponse, HttpResponseBase } from '@angular/common/http';
  
  export const API_BASE_URL = new InjectionToken&lt;string&gt;('API_BASE_URL');
  
  @Injectable({
  providedIn:'root'
  })
  export class CompanyInfoService {
      private http: HttpClient;
      private baseUrl: string;
      protected jsonParseReviver: ((key: string, value: any) =&gt; any) | undefined = undefined;
  
      constructor(@Inject(HttpClient) http: HttpClient, @Optional() @Inject(API_BASE_URL) baseUrl?: string) {
          this.http = http;
          this.baseUrl = baseUrl ? baseUrl : "https://localhost:44311";
      }
  
      getCompanyInfoOption(): Observable&lt;FileResponse | null&gt; {
          let url_ = this.baseUrl + "/api/company-info";
          url_ = url_.replace(/[?&amp;]$/, "");
  
          let options_ : any = {
              observe: "response",
              responseType: "blob",
              headers: new HttpHeaders({
                  "Accept": "application/octet-stream"
              })
          };
  
          return this.http.request("get", url_, options_).pipe(_observableMergeMap((response_ : any) =&gt; {
              return this.processGetCompanyInfoOption(response_);
          })).pipe(_observableCatch((response_: any) =&gt; {
              if (response_ instanceof HttpResponseBase) {
                  try {
                      return this.processGetCompanyInfoOption(&lt;any&gt;response_);
                  } catch (e) {
                      return &lt;Observable&lt;FileResponse | null&gt;&gt;&lt;any&gt;_observableThrow(e);
                  }
              } else
                  return &lt;Observable&lt;FileResponse | null&gt;&gt;&lt;any&gt;_observableThrow(response_);
          }));
      }
  
      protected processGetCompanyInfoOption(response: HttpResponseBase): Observable&lt;FileResponse | null&gt; {
          const status = response.status;
          const responseBlob =
              response instanceof HttpResponse ? response.body :
              (&lt;any&gt;response).error instanceof Blob ? (&lt;any&gt;response).error : undefined;
  
          let _headers: any = {}; if (response.headers) { for (let key of response.headers.keys()) { _headers[key] = response.headers.get(key); }}
          if (status === 200 || status === 206) {
              const contentDisposition = response.headers ? response.headers.get("content-disposition") : undefined;
              const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
              const fileName = fileNameMatch &amp;&amp; fileNameMatch.length &gt; 1 ? fileNameMatch[1] : undefined;
              return _observableOf({ fileName: fileName, data: &lt;any&gt;responseBlob, status: status, headers: _headers });
          } else if (status !== 200 &amp;&amp; status !== 204) {
              return blobToText(responseBlob).pipe(_observableMergeMap(_responseText =&gt; {
              return throwException("An unexpected server error occurred.", status, _responseText, _headers);
              }));
          }
          return _observableOf&lt;FileResponse | null&gt;(&lt;any&gt;null);
      }
  </code></pre>
  
  <p>how can i call this service in my component? i am trying to call with subscribe method in ngOnInit of component</p>
  
  <pre><code>  ngOnInit(): void {
        this.service.getCompanyInfoOption().subscribe(
          value =&gt; {
            console.log(value);
          },
          error =&gt; console.error(JSON.stringify(error)),
          () =&gt; console.log('done')
        );
    }
  </code></pre>
  
  <p>I am getting this output after calling getCompanyInfoOption api</p>
  
  <p><a href="https://i.stack.imgur.com/6s2YA.png" rel="nofollow noreferrer">Console Log</a></p>
  
  <p>My c# controller</p>
  
  <p><a href="https://i.stack.imgur.com/Jvtda.png" rel="nofollow noreferrer">ASP .net core C# controller</a></p>
  
  <p>The type of response of compantInfoOption send in ok is given below</p>
  
  <p><a href="https://i.stack.imgur.com/ZLsP7.png" rel="nofollow noreferrer">conpanyInfoOption type</a></p>