OpenAPITools / openapi-generator

OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
https://openapi-generator.tech
Apache License 2.0
21.82k stars 6.58k forks source link

[BUG] typescript-axios doesn't export models when withSeparateModelsAndApi flag is true #6423

Open benwiley4000 opened 4 years ago

benwiley4000 commented 4 years ago

Bug Report Checklist

Description

I'm using the typescript-axios generator with the withSeparateModelsAndApi flag:

withSeparateModelsAndApi: true
apiPackage: 'api'
modelPackage: 'model'

Basically, when using this, the models aren't exported from the root package:

// index.d.ts
export * from "./api";
export * from "./configuration";

However both the API classes and models are correctly included with the default setup which uses a single file for everything. It would be desirable to export the models in all cases. The separate-file structure is much nicer for editors that are slow processing large files.

openapi-generator version

5.0.0-SNAPSHOT

OpenAPI declaration file content or url

See above

Command line used for generation
Steps to reproduce
Related issues/PRs
Suggest a fix

Just export the modelPackage directory as well, don't think it's super complicated.

ETA: Apologies for not editing the description when I first posted this.

ETA Again: withSeparateModelsAndApi: true - I accidentally included false before because that was the config I was debugging with. Sorry for being sloppy today!

hleb-albau commented 4 years ago

same behavior

calvinwyoung commented 4 years ago

@benwiley4000 PR #6873 was just merged to fix this — you should be able to close this issue now.