[Javascript] useES6 is the default even though it shouldn't be
Description
the ES5 templates should be used by default when generating a javascript client but it seems that the ES6 templates are actually being used by default.
Swagger-codegen version
3.0.19 ... not sure if this has worked in previous versions.
Swagger declaration file content or url
Used the petstore example to verify this issue
Command line used for generation
swagger-codegen generate -i https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/examples/v3.0/petstore.yaml -o testJavascript/ -l javascript
Steps to reproduce
swagger-codegen generate -i https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/examples/v3.0/petstore.yaml -o testJavascript/ -l javascript
Related issues/PRs
Is there a way to generate a ES5 client? I run below which doesn't seem to work though
# swagger-codegen: stable 3.0.20, installed via homebrew(`brew install swagger-codegen`)
# macOS: 10.15.5
# JDK: adoptopenjdk8, installed via homebrew(`brew cask install homebrew/cask-versions/adoptopenjdk8`)
swagger-codegen generate -i http://MY_SERVER/v2/swagger/governator-jaxrs.json -l javascript --additional-properties useES6=false
I'm facing this issue also.. I created configuration file and added useES6 option like below
{
"useES6": false
}
But this options seems like not work;
anyone ever resolved this?
I'm getting this same issue, I can't work out how to force it to use ES5
I see... well, let's get this fixed :)
I reviewed this issue and it was already fixed, so glong to close it. If you don't want to use ES6 templates. You just need to add the option:
--additional-properties useES6=false
in your CLI for code generation
That's weird, when I try swagger-codegen generate -i $api_url -l javascript -o out --additional-properties useES6=false it still generates code with class keyword classes
What codegen version are you using?
El mié, 7 feb 2024, 7:50 p. m., Jo @.***> escribió:
That's weird, when I try swagger-codegen generate -i $api_url -l javascript -o out --additional-properties useES6=false it still generates code with class keyword classes
— Reply to this email directly, view it on GitHub https://github.com/swagger-api/swagger-codegen/issues/10305#issuecomment-1933185179, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAY5QMEE2BPQKOMYHG5TQHTYSQONTAVCNFSM4NW7O4Y2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOJTGMYTQNJRG44Q . You are receiving this because you modified the open/close state.Message ID: @.***>
I'm using 3.0.52, I installed via brew
@waterwheels I noted the problem is actually the templates, no the option. Anyway this could be addressed in a different ticket.