swagger-api / swagger-api/swagger-codegen
Broken typescript-angular default.service.ts
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Description
The generated angular file default.service.ts uses wrong import path delimiters on windows installation.
import { UpdateInfo } from '../model\updateInfo';
Most propably it is using windows path seperator while doing path concatenation, what is not correct way how angular import path should be constructed.
Expected value is import { UpdateInfo } from '../model/updateInfo';
The generated file has also missing } bracket before EOF.
There is missing body parameter in generated post method:
return this.httpClient.post(${this.basePath}/someurl,
body, ---is missing in generated code
{ ....
The import path issue is also in generated api.module.ts containing
import { DefaultService } from './api\default.service';
The generation was invoked by swager-codegen-cli with parameter -l typescript-angular
Swagger-codegen version
3.0.rc2 and 3.0.4
Swagger declaration file content or url
Command line used for generation
Steps to reproduce
Related issues/PRs
Suggest a fix/enhancement
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 the typescript-angular generation entry point used by swagger-codegen-cli and compare the generated default.service.ts and api.module.ts shown in the report. Verify the path separators, missing closing brace, and post body parameter against the expected output; done means regenerated files are valid TypeScript with the reported corrections.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- angular, typescript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100