Skip to content

[TypeScript-Fetch] Local variables can conflict with parameters #6698

Closed
@masaeedu

Description

@masaeedu
Description

The typescript-fetch client template inserts local variables with names like path, which is a fairly common name for API parameters. If an API has a parameter named path, the generated client will have a compile error and the transpiled code can have subtle bugs.

Swagger-codegen version

Issue is present in 96137e5. Specifically, the lines starting here.

Swagger declaration file content or url

Latest Docker API spec

Command line used for generation
generate -i /moby/api/swagger.yaml -l typescript-fetch -o /package
Suggest a fix/enhancement

Use mangled names for the local variables (e.g. const ____path or such).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions