Skip to content

Commit

Permalink
Merge pull request #9452 from swagger-api/fix-generate-options
Browse files Browse the repository at this point in the history
fix generate options
  • Loading branch information
frantuma authored May 20, 2019
2 parents 05db33c + 83a3de0 commit dedb5ce
Showing 1 changed file with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,17 @@ private String getHost() {
protected void configureGeneratorProperties() {
// allows generating only models by specifying a CSV of models to generate, or empty for all
// NOTE: Boolean.TRUE is required below rather than `true` because of JVM boxing constraints and type inference.
isGenerateApis = System.getProperty(CodegenConstants.APIS) != null ? Boolean.TRUE : getGeneratorPropertyDefaultSwitch(CodegenConstants.APIS, null);
isGenerateModels = System.getProperty(CodegenConstants.MODELS) != null ? Boolean.TRUE : getGeneratorPropertyDefaultSwitch(CodegenConstants.MODELS, null);
isGenerateSupportingFiles = System.getProperty(CodegenConstants.SUPPORTING_FILES) != null ? Boolean.TRUE : getGeneratorPropertyDefaultSwitch(CodegenConstants.SUPPORTING_FILES, null);
if (System.getProperty(CodegenConstants.GENERATE_APIS) != null) {
isGenerateApis = Boolean.valueOf(System.getProperty(CodegenConstants.GENERATE_APIS));
} else {
isGenerateApis = System.getProperty(CodegenConstants.APIS) != null ? Boolean.TRUE : getGeneratorPropertyDefaultSwitch(CodegenConstants.APIS, null);
}
if (System.getProperty(CodegenConstants.GENERATE_MODELS) != null) {
isGenerateModels = Boolean.valueOf(System.getProperty(CodegenConstants.GENERATE_MODELS));
} else {
isGenerateModels = System.getProperty(CodegenConstants.MODELS) != null ? Boolean.TRUE : getGeneratorPropertyDefaultSwitch(CodegenConstants.MODELS, null);
}
isGenerateSupportingFiles = System.getProperty(CodegenConstants.SUPPORTING_FILES) != null ? Boolean.valueOf(System.getProperty(CodegenConstants.SUPPORTING_FILES)) : getGeneratorPropertyDefaultSwitch(CodegenConstants.SUPPORTING_FILES, null);

if (isGenerateApis == null && isGenerateModels == null && isGenerateSupportingFiles == null) {
// no specifics are set, generate everything
Expand Down

0 comments on commit dedb5ce

Please sign in to comment.