Swagger Codegen Selective Generation
You may not want to generate all models in your project. Likewise you may want just one or two apis to be written. If that’s the case, you can use system properties to control the output:
The default is generate everything supported by the specific library. Once you enable a feature, it will restrict the contents generated:
To control the specific files being generated, you can pass a CSV list of what you want:
To control generation of docs and tests for api and models, pass false to the option. For api, these options are -DapiTests=false
and -DapiDocs=false
. For models, -DmodelTests=false
and -DmodelDocs=false
.
These options default to true and don’t limit the generation of the feature options listed above (like -Dapi
):
When using selective generation, only the templates needed for the specific generation will be used.