Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion docs/debugging.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,16 @@ openapi-generator generate -g go \
Or you can add these to your `JAVA_OPTS` environment variable (this applies to every invocation of the tool):

```bash
export JAVA_OPTS="${JAVA_OPTS} --global-property debugModels,debugOperations"
export JAVA_OPTS="${JAVA_OPTS} -Dlog.level=debug --global-property debugModels,debugOperations"
```

> NOTE: Globally available system options like these will apply to all invocations of the generator (CLI and plugins)

> NOTE: If you invoke the tool via Java, you will need to provide the options directly to the `java` and `openapi-generator generate` command-line instead, for example:
```
java -Dlog.level=debug -jar .../openapi-generator-cli.jar generate --global-property debugModels,debugOperations ...
```

## Runtime

When you're working with a custom generator, a new generator, or otherwise trying to understand the behavior of the toolset, you may need to attach a remote debugger in order to step through the code.
Expand Down Expand Up @@ -226,6 +231,11 @@ You can try to enable debugging log with `-Dlog.level=debug` option to the `JAVA
export JAVA_OPTS="${JAVA_OPTS} -Dlog.level=debug"
```

> NOTE: If you invoke the tool via Java directly, you must provide the property directly to its command line, for example:
```bash
java -Dlog.level=debug -jar ...
```

Set the option then DEBUG logs are printed out:

```bash
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ void generateModels(List<File> files, List<ModelMap> allModels, List<String> unu
}
if (GlobalSettings.getProperty("debugModels") != null) {
LOGGER.info("############ Model info ############");
Json.prettyPrint(allModels);
LOGGER.info(Json.pretty(allModels));
}
}

Expand Down Expand Up @@ -841,7 +841,7 @@ void generateApis(List<File> files, List<OperationsMap> allOperations, List<Mode
}
if (GlobalSettings.getProperty("debugOperations") != null) {
LOGGER.info("############ Operation info ############");
Json.prettyPrint(allOperations);
LOGGER.info(Json.pretty(allOperations));
}

}
Expand Down Expand Up @@ -1000,7 +1000,7 @@ void generateWebhooks(List<File> files, List<WebhooksMap> allWebhooks, List<Mode
}
if (GlobalSettings.getProperty("debugOperations") != null) {
LOGGER.info("############ Operation info ############");
Json.prettyPrint(allWebhooks);
LOGGER.info(Json.pretty(allWebhooks));
}

}
Expand Down Expand Up @@ -1214,7 +1214,7 @@ Map<String, Object> buildSupportFileBundle(List<OperationsMap> allOperations, Li

if (GlobalSettings.getProperty("debugSupportingFiles") != null) {
LOGGER.info("############ Supporting file info ############");
Json.prettyPrint(bundle);
LOGGER.info(Json.pretty(bundle));
}
return bundle;
}
Expand Down
Loading