Open bard opened 4 years ago
👍 Thanks for opening this issue! 🏷 I have applied any labels matching special text in your issue.
The team will review the labels and make any necessary changes.
It's been over two years since this bug is open. Are there any plans to fix it?
A temporary workaround for anyone who is waiting for the fix:
"error"
eslint --fix
on the code generated by openapi-generatorHopefully it won't be needed soon but meanwhile this can be used to fix the code automatically.
Now the Issue has been fixed and the configuration Type has the right export:
export * from "./http/http";
export * from "./auth/auth";
export * from "./models/all";
export { createConfiguration } from "./configuration"
export type { Configuration } from "./configuration"
export * from "./apis/exception";
export * from "./servers";
export { RequiredError } from "./apis/baseapi";
export { PromiseMiddleware as Middleware } from './middleware';
But in the same file the PromiseMiddleware Type has the wrong export:
export { PromiseMiddleware as Middleware } from './middleware';
I wonder if you can file a PR to fix it 🙏
export { PromiseMiddleware as Middleware } from './middleware';
I wonder if you can file a PR to fix it 🙏
Okay a PR is not necessary. I took a look at the code and i saw that the export type will be set when the addditional property platform=deno is set. For example: openapi-generator generate -g typescript -i ./schema.yaml -o ./Client --additional-properties=platform=deno
Output-File:
export { PromiseMiddleware as Middleware } from './middleware';
I wonder if you can file a PR to fix it 🙏
Okay a PR is not necessary. I took a look at the code and i saw that the export type will be set when the addditional property platform=deno is set. For example: openapi-generator generate -g typescript -i ./schema.yaml -o ./Client --additional-properties=platform=deno
Output-File:
Nevermind. The deno Version is not compatible with node. I will create a PR
Bug Report Checklist
Description
Using the new TypeScript generator from #6341
The generated code is not compatible with
--isolatedModules
, which is required by popular setups such ascreate-react-app
.openapi-generator version
5.0.0-SNAPSHOT
OpenAPI declaration file content or url
https://github.com/bard/repro-openapi-generator-typescript-isolated-modules/blob/master/example.yaml
Command line used for generation
OPENAPI_GENERATOR_VERSION=5.0.0-SNAPSHOT /tmp/openapi-generator-cli.sh generate -g typescript -i example.yaml -o ./src/api
Steps to reproduce
git clone https://github.com/bard/repro-openapi-generator-typescript-isolated-modules/blob/master/example.yaml
OPENAPI_GENERATOR_VERSION=5.0.0-SNAPSHOT /tmp/openapi-generator-cli.sh generate -g typescript -i example.yaml -o ./src/api
yarn && yarn start
Related issues/PRs
https://github.com/facebook/create-react-app/issues/6054
Suggest a fix
Possible workaround is to export
*
fromindex.ts
: