Skip to content

[typescript-inversify] generates unusable code #9785

Closed
@michalzubkowicz

Description

@michalzubkowicz
Description

typescript-inversify generates unusable code, with TypeScript warnings, also services are injected in a way that doesn't work with current version of inversify:
inversify/InversifyJS#1004 (comment)

Swagger-codegen version

2.4.9

Command line used for generation

swagger-codegen-cli.jar -l typescript-inversify

Suggest a fix/enhancement
  1. Move DI classses from contructor to properties (api.service.mustache)
  2. Replace type casting from <> to "as" (TS recommend that)
  3. Replace == with ===
  4. Remove redundant local variable basePath.
  5. fix quotemarks

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