swagger-api / swagger-api/swagger-codegen

[TypescriptAngular] Several Bugs

Open
#6,370 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Client: TypeScript Issue: Bug
Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Description
  1. When interfaces option is activated:
  • It generates "endpoint".serviceInterface-like files.
  • However "endpoint.service.ts class: import { AccountServiceInterface } from './AccountServiceInterface'; So, AccountServiceInterface file doesn't exist. So compiler breaks.
  1. When inerfaces option is activated:
  • It generates "endpoint".serviceInterface-like files.
  • On there models are imported. Currently, I'm not using any model, however it generates this line: import * as models from '../model/models';. So compiler breaks.
  1. Also, index.ts also exports models, regardless of whether models exist.
  • This line is generated: export * from './model/models';
  • So, compiler is telling: `file: ...index.ts' .../models.ts is not a module.'
Swagger-codegen version

I'm using last 3.0.0 branch.

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

Inspect the TypeScript Angular templates or entry points that generate endpoint.service.ts, service-interface files, index.ts, and model/models.ts. Reproduce generation with interfaces enabled and no models, then verify the generated project compiles without imports or exports for files that were not created.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, typescript
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 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.