I am generating model in JavaScript with -Dmodels
option. The generated code contains require
module loader used in Node, but I am using Vue Js.
So, I have problem when I require these files in Vue Js project. It gives me an error about superagent
- it suppose I will use superagent
which is also autogenerated.
What I want is to generate pure models with ES6 export/import statements. Is it possible with Swagger Codegen or should I use something else?
Currently, I am using openapi-client but there is no support for model generation.
So, like it usually happens - you find your answer after you ask a question :)
I found there is an option --additional-properties
you can provide like:
java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate -i path-to-your-file.yaml -l javascript --additional-properties useES6=true
You can list all available options with the following command:
java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar config-help -l javascript