Skip to content

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

Open
@eshlox

Description

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    bug 🔥Something isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions