[generator] Cleanup debugOpenAPI usage/display text (#804)

This commit is contained in:
Jim Schubert
2018-08-13 23:45:50 -04:00
committed by William Cheng
parent 08ca54d3d5
commit 7acba8a4d8
3 changed files with 9 additions and 8 deletions

View File

@@ -169,14 +169,15 @@ public class DefaultGenerator extends AbstractGenerator implements Generator {
if (!generateApiTests && !generateModelTests) {
config.additionalProperties().put(CodegenConstants.EXCLUDE_TESTS, true);
}
// for backward compatibility
if (System.getProperty("debugSwagger") != null) {
LOGGER.info("Please use system property 'debugOpenAPI' instead of 'debugSwagger'.");
Json.prettyPrint(openAPI);
}
if (System.getProperty("debugOpenAPI") != null) {
Json.prettyPrint(openAPI);
} else if (System.getProperty("debugSwagger") != null) {
// This exists for backward compatibility
// We fall to this block only if debugOpenAPI is null. No need to dump this twice.
LOGGER.info("Please use system property 'debugOpenAPI' instead of 'debugSwagger'.");
Json.prettyPrint(openAPI);
}
config.processOpts();

View File

@@ -596,12 +596,12 @@ public class CodegenConfigurator implements Serializable {
return;
}
LOGGER.info("\nVERBOSE MODE: ON. Additional debug options are injected" +
"\n - [debugSwagger] prints the openapi specification as interpreted by the codegen" +
"\n - [debugOpenAPI] prints the OpenAPI specification as interpreted by the codegen" +
"\n - [debugModels] prints models passed to the template engine" +
"\n - [debugOperations] prints operations passed to the template engine" +
"\n - [debugSupportingFiles] prints additional data passed to the template engine");
System.setProperty("debugSwagger", "");
System.setProperty("debugOpenAPI", "");
System.setProperty("debugModels", "");
System.setProperty("debugOperations", "");
System.setProperty("debugSupportingFiles", "");