swagger-codegen icon indicating copy to clipboard operation
swagger-codegen copied to clipboard

[TypescriptAngular] Several Bugs

Open jeusdi opened this issue 9 years ago • 4 comments

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.

jeusdi avatar Aug 24 '17 10:08 jeusdi

cc @TiFu @taxpon @sebastianhaas @kenisteward @Vrolijkx

wing328 avatar Sep 04 '17 16:09 wing328

This is an edge case that wasn't consider it looks like. Most people have models so that wasn't covered. We could either generate an empty models file or conditionally generate that line based on if we have it or not.

As for the interface issue I never really understood the purpose of the interfaces but I'll try to check it out sometime this week

kenisteward avatar Sep 04 '17 17:09 kenisteward

I'll try to check it out sometime this week

Me too.

sebastianhaas avatar Sep 05 '17 12:09 sebastianhaas

@feikede can you fix it ?

inidona avatar May 17 '18 12:05 inidona