Generating the typescript-angular files from the downloaded jar swagger-codegen-cli-3.0.34.jar
Command
java -jar tools/swagger-codegen-cli-3.0.34.jar generate \
-i http://localhost:8080/swagger/fete-bird-api-gateway-0.0.yml \
-l typescript-angular \
-o libs/service/src/lib/swagger-specification \
-Dmodels=true \
-DmodelDocs=false -DmodelTests=false \
-c tools/angular-swagger-option.json
The files are generated successfully, however, I am trying to generate only the models not the API, but the above command-generated API as well

Followed the instructions from https://github.com/swagger-api/swagger-codegen
# generate only models
java -Dmodels {opts}
# generate only apis
java -Dapis {opts}
# generate only supporting files
java -DsupportingFiles
# generate models and supporting files
java -Dmodels -DsupportingFiles
Not sure what should I pass {opts} so, that it generates only Models not api
For the CLI, you can comma-delimit -D params.
java -jar tools/swagger-codegen-cli-3.0.34.jar generate \
-i http://localhost:8080/swagger/fete-bird-api-gateway-0.0.yml \
-l typescript-angular \
-o libs/service/src/lib/swagger-specification \
-Dmodels=true,modelDocs=false,modelTests=false \
-c tools/angular-swagger-option.json
It is weird that the docs are wrong where. It's possible that they changed how they parsed options at one point. If you're interested in contributing to open source software, you could conceivably open a pull request to fix them!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With