swagger-typescript-api icon indicating copy to clipboard operation
swagger-typescript-api copied to clipboard

improve binary payload support

Open robbertvc opened this issue 3 years ago • 0 comments

Hi. Thanks for the very useful generator. We had some issues where the generated code was slightly wrong in the case of binary payloads when using Axios though. This PR contains some fixes which were useful for our specific needs:

  • fix missing responseFormat for requests which have an octet-stream content-type response
  • use ArrayBuffer type instead of File for both browser and node compatibility

Let me known if you are interested in merging some of these fixes - with or without additional code changes. Thanks!

Example section (used for sending protobuf responses):

      requestBody:
       content:
         application/octet-stream:
           schema:
             type: string
             format: binary
       required: true

robbertvc avatar Jan 12 '22 16:01 robbertvc