-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support generating ESM OpenAPI clients #4476
Comments
Hey @sven-petersen, thank you for the suggestion, we will discuss it. The ESM topic is generally on our radar as well 😊 |
We have discussed this and took it into our backlog. This will require a bit of investigation to understand whether just switching the endings for the imports is enough. Also, we would have to add a few more tests for ESM. Still, for now, I cannot give you a timeline, when this might be worked on. |
Is your feature request related to a problem? Please describe.
We want to setup a new Typescript Node project using the newer ESM syntax. We also want to generate an OpenAPI client using the Cloud SDK that then shall be used in the Node project. The generated client however uses relative imports without file extensions like so
When using the ESM syntax it is required to specify the file extension for relative imports. So when the client is (re-)generated it currently is required to manually add the
.js
file extension to all relative import statements.Describe the solution you'd like
It would be nice to e.g. a flag for the generator to choose between ESM and CommonJS (import) syntax. Or generally any way to make the generated code work with an ESM based project without having to make manual changes.
Describe alternatives you've considered
Impact / Priority
Additional context
The text was updated successfully, but these errors were encountered: