Skip to content

Commit

Permalink
[generator] Cleanup debugOpenAPI usage/display text (#804)
Browse files Browse the repository at this point in the history
  • Loading branch information
jimschubert authored and wing328 committed Aug 14, 2018
1 parent 08ca54d commit 7acba8a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -169,14 +169,15 @@ private void configureGeneratorProperties() {
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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -596,12 +596,12 @@ private void setVerboseFlags() {
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", "");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ the object you have available during client generation:

```
# The following additional debug options are available for all codegen targets:
# -DdebugSwagger prints the OpenAPI Specification as interpreted by the codegen
# -DdebugOpenAPI prints the OpenAPI Specification as interpreted by the codegen
# -DdebugModels prints models passed to the template engine
# -DdebugOperations prints operations passed to the template engine
# -DdebugSupportingFiles prints additional data passed to the template engine
Expand Down

0 comments on commit 7acba8a

Please # to comment.