-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
[BUG] typescript-fetch should not use namespaces (SyntaxError: Namespaces are not supported.) #1947
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
Comments
👍 Thanks for opening this issue! The team will review the labels and make any necessary changes. |
@ceefour sounds good. do you want to file a PR for that? |
@ceefour your suggestion
works as long as their isn't another enum with the same name. For instance with the pet store examples that's the case and you end up with the following error within the models barrel:
So to prevent this I'd suggest to prefix the enum with the namespace. |
@macjohnny |
@willianscfa the starting point for the code generation template is here: Lines 93 to 112 in 0a2fb8d
the controller is here https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java after running
you can test the result with
|
typescript-axios client has same problem.Is there any update plan for that client? |
@Rassilion you could add this to your plans and support us fixing it ;-) |
Bug Report Checklist
Description
Generated files result in error: (e.g. in
create-react-app
with TypeScript support)Adding configuration
supportsES6: true
doesn't help.Via @DanielRosenwasser - facebook/create-react-app#4837 (comment) :
via @Timer - facebook/create-react-app#5681 (comment) :
openapi-generator version
0.0.7-4.0.0-beta
OpenAPI declaration file content or url
anything that uses enum
Command line used for generation
Steps to reproduce
typescript-fetch
Related issues/PRs
Suggest a fix
Remove the namespace and use the enum directly in the module.
The text was updated successfully, but these errors were encountered: