Skip to main content

Global Properties

Available Global Properties

PropertyDescriptionAcceptable value
debugOpenAPIDumps JSON formatted and fully parsed OpenAPI document during generationnone
debugModelsDumps JSON formatted template-bound model information during generationnone
debugOperationsDumps JSON formatted template-bound operation information during generationnone
debugSupportingFilesDumps JSON formatted Supporting File information during generationnone
verboseDefines the verbositytrue or false
generateAliasAsModelDefines whether primitive types defined at the model/schema level will be wrapped in a modeltrue or false
org.openapitools.codegen.utils.oncelogger.enabledEnable/disable the "OnceLogger" which reduces noise for select repeated logstrue or false
supportingFilesAllows the user to define which supporting files will be generated. Prefer using the more robust .openapi-generator-ignore.no value, or a colon-separated string of file names
modelsAllows the user to define which models will be generated. Prefer using the more robust .openapi-generator-ignore.no value, or a colon-separated string of model names
apisAllows the user to define which apis will be generated. Prefer using the more robust .openapi-generator-ignore.no value, or a colon-separated string of api names
apiDocsAllows the user to define if api docs will be generated. Prefer using the more robust .openapi-generator-ignore.true or false
modelDocsAllows the user to define if model docs will be generated. Prefer using the more robust .openapi-generator-ignore.true or false
apiTestsAllows the user to define if api tests will be generated. Prefer using the more robust .openapi-generator-ignore.true or false
modelTestsAllows the user to define if model tests will be generated. Prefer using the more robust .openapi-generator-ignore.true or false

Note on Global Property declaration

There are two ways to provide selective generation properties or "global properties". First, these can be passed as Java System Properties. Second, these can be passed via the global property tooling option (--global-property in CLI and globalProperty in Maven and Gradle configurations). This differentiation is new in version 5.0 with the removal of the -D CLI option and the renaming of systemProperties. If you're upgrading to OpenAPI Generator 5.0+

While the examples seen in Customization use the Java System Property syntax, keep in mind that the following are equivalent:

java -Dmodels {jar} generate {opts}

and

java {jar} generate {opts} --global-property=models

Why the two differing ways to provide the same properties? We previously accepted a -D tooling option which resembled Java System Property declaration. In older versions of OpenAPI Generator, the option modified the SystemProperties collection directly and was truly a "system property". This option changed during the 4.x release in an effort to make OpenAPI Generator thread-safe and isolate its configuration via thread locals. We no longer mutate System Properties. In the 4.x release and earlier, specifying the tooling -D option with system properties intended for other tools like swagger-parser rather than passing them as true Java System Properties would lead to unexpected behavior for the user; if our tool set the system property after invoking certain code, it would seem to the user like Java System Properties weren't working!