Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Buffer type breaks generated SDKs #311

Open
balanza opened this issue Jan 4, 2023 · 1 comment
Open

Buffer type breaks generated SDKs #311

balanza opened this issue Jan 4, 2023 · 1 comment

Comments

@balanza
Copy link
Contributor

balanza commented Jan 4, 2023

Operations which produce octet/stream responses will be resolved into generated definitions using Buffer as defined in #293

This breaks the build of SDK packages as Buffer is not a native Typescript type

Example

swagger: '2.0'
info:
  version: 1.0.0
  title: API
host: localhost
basePath: /api/v1
schemes:
  - https
paths:
  /mypath:
    get:
      summary: An endpoint
      produces:
        - application/octet-stream
      responses:
        '200':
          description: Success
          schema:
            format: binary
            type: string
        '400':
          description: Bad Request
        '500':
          description: Internal Server Error
requestTypes.ts:2047:8 - error TS4016: Type parameter 'A0' of exported function has or is using private name 'Buffer'.
@balanza
Copy link
Contributor Author

balanza commented Jan 4, 2023

The easier solution would be to add @types/node as a dev dependency of the generated package. I have some concerns:

  1. Should we use a specific version of Node?
  2. Is it correct to reference Node? SDKs are meant to be used both in a Node application and in the browser.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant