Skip to content

[typescript-fetch] Generated authentication configuration file has compile error if the apikey name contains dash - #6324

@LeonLiuY

Description

@LeonLiuY
Description

The generated authentication configuration file configuration.ts has compile error if the apikey name contains dash -.

https://github.com/wing328/swagger-codegen/blob/master/modules/swagger-codegen/src/main/resources/TypeScript-Fetch/configuration.mustache#L5

securityDefinitions:
  APIKeyHeader:
    type: apiKey
    in: header
    name: X-API-Key

keyParamName has the same string value with swagger spec. Dash is allowed in HTTP header name but not in typescript object key name.

Swagger-codegen version

Official CLI Docker container (master branch)

Related issues/PRs

#4008

Suggest a fix/enhancement

Convert the name to TypeScript compatible identifier in the generated code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions