swagger-api / swagger-api/swagger-codegen
[typescript-angular] some models missing from api/*.service.ts imports -- 2.3.0
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Description
additionalProperties models are not imported in generated typescript-angular api/*.service.ts files.
Swagger-codegen version
2.3.0
Swagger declaration file content or url
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": {
"type": "array",
"items": {
"$ref": "#/definitions/MissingInServiceImports"
}
}
}
}
}
Entire swagger declaration file in this repo: https://github.com/jacksloan/broken-imports-typescript-codegen
Command line used for generation
java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate \
-i swagger-spec.json \
-l typescript-angular \
--additional-properties npmRepository=https://nexus.xyz.com/repository/npm-internal \
--additional-properties npmName=codegen-xyz \
--additional-properties npmVersion=0.0.1 \
--additional-properties ngVersion=4.3.0
Steps to reproduce
Run typescript-angular codegen against the spec file here: https://github.com/jacksloan/broken-imports-typescript-codegen
Related issues/PRs
--
Suggest a fix/enhancement
I'll see what I can come up with. As a guess, could it be related to line 67-71 here?
https://github.com/swagger-api/swagger-codegen/blob/master/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/TypeScriptAngularClientCodegen.java
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with TypeScriptAngularClientCodegen.java around the referenced lines 67-71, then run the provided swagger-codegen command against the linked swagger-spec.json. Compare the generated typescript-angular api/*.service.ts files with the referenced definition and ensure models used through additionalProperties are imported.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- angular, java, typescript
- Domain
- api, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100