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

TS2783: Content-Type is specified more than once, so this usage will be overwritten. #1737

Open
eshlox opened this issue Feb 20, 2025 · 2 comments
Labels
bug 🔥 Something isn't working

Comments

@eshlox
Copy link

eshlox commented Feb 20, 2025

Description

Adding header parameters to the OpenAPI file (https://swagger.io/docs/specification/v3_0/describing-parameters/#header-parameters) results in a TypeScript error in the SDK.

TS2783: Content-Type is specified more than once, so this usage will be overwritten.
sdk. gen. ts(83, 7): This spread always overwrites this property.

Please review the provided example. I've updated the addPet operation to include a Content-Type parameter.

      parameters:
        - in: header
          name: Content-Type
          schema:
            type: string
          required: true

You might need to execute npm run openapi-ts.

Image

Reproducible example or configuration

https://stackblitz.com/edit/hey-api-client-fetch-example-p13yhgc9?file=src%2Fclient%2Fsdk.gen.ts

OpenAPI specification (optional)

No response

System information (optional)

No response

@eshlox eshlox added the bug 🔥 Something isn't working label Feb 20, 2025
Copy link

stackblitz bot commented Feb 20, 2025

@mrlubos
Copy link
Member

mrlubos commented Feb 20, 2025

Thanks for reporting @eshlox!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🔥 Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants