forked from loafle/openapi-generator-original
[generator] Cleanup debugOpenAPI usage/display text (#804)
This commit is contained in:
committed by
William Cheng
parent
08ca54d3d5
commit
7acba8a4d8
@@ -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();
|
||||
|
||||
@@ -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", "");
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user