swagger-api / swagger-api/swagger-codegen

[typescript-angular] Type Map is missing generic Arguments

Open
#11,115 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Description

When generating the Code the entity-interfaces inside the module-directory have this property:

readonly context?: string | Map;

This line prevents "npm run build" from successfully executing because Map is missing two generic arguments
I have to add the arguments by hand like this:

readonly context?: string | Map<any, any>;

Swagger-codegen version

3.0.27 Current stable

Command line used for generation

java -jar swagger-codegen-cli.jar generate -i swagger.json -l typescript-angular

Steps to reproduce

I tried to reproduce this issue with the petstore.json but the generated code does not include the above mentioned property.
Attached is the swagger.json file I used.

Suggest a fix/enhancement

The Map-property should be generated with generic Arguments.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the typescript-angular generator output for the supplied swagger.json and trace how the entity interfaces render the context property. Run the stated java -jar swagger-codegen-cli.jar generate command, then npm run build; done means the generated Map type includes generic arguments and the build succeeds.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, java, typescript
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.