swagger-api / swagger-api/swagger-codegen

[typescript-angular] Missing import

Open
#11,745 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

Bug: missing import in the generated Typescript service

Swagger-codegen version

Bug reproduced at versions 2.4.9 and 3.0.33

Swagger declaration file content or url

JSON available here

Command line used for generation
java -jar swagger-codegen-cli-3.0.33.jar generate -i "model.json" -o "generated" -l typescript-angular
Steps to reproduce

Execute the command line above with this model.json

The generated api/userMapReturnController.service file needs an additional import to compile:

import {User} from "../model/user";

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

Run the provided swagger-codegen command with the linked model.json and inspect the generated api/userMapReturnController.service file. Then trace the typescript-angular generator template responsible for that service and verify the generated client compiles without a missing User import.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.