You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/customization.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -90,7 +90,8 @@ You can use this as additional dependency of the `openapi-generator-maven-plugin
90
90
If you publish your artifact to a distant maven repository, do not forget to add this repository as `pluginRepository` for your project.
91
91
92
92
## Selective generation
93
-
You may not want to generate *all* models in your project. Likewise you may want just one or two apis to be written. If that's the case, you can use system properties to control the output:
93
+
94
+
You may not want to generate *all* models in your project. Likewise, you may want just one or two apis to be written. If that's the case, you can use system properties or [global properties](./global-properties.md) to control the output.
94
95
95
96
The default is generate *everything* supported by the specific library. Once you enable a feature, it will restrict the contents generated:
| debugOpenAPI | Dumps JSON formatted and fully parsed OpenAPI document during generation | none |
11
+
| debugModels | Dumps JSON formatted template-bound model information during generation | none |
12
+
| debugOperations | Dumps JSON formatted template-bound operation information during generation | none |
13
+
| debugSupportingFiles | Dumps JSON formatted Supporting File information during generation | none |
14
+
| verbose | Defines the verbosity |`true` or `false`|
15
+
| generateAliasAsModel | Defines whether primitive types defined at the model/schema level will be wrapped in a model |`true` or `false`|
16
+
| org.openapitools.codegen.utils.oncelogger.enabled | Enable/disable the "OnceLogger" which reduces noise for select repeated logs |`true` or `false`|
17
+
| supportingFiles | Allows the user to define which supporting files will be generated. Prefer using the more robust `.openapi-generator-ignore`. | no value, or a comma-separated string of file names |
18
+
| models | Allows the user to define which models will be generated. Prefer using the more robust `.openapi-generator-ignore`. | no value, or a comma-separated string of model names |
19
+
| apis | Allows the user to define which apis will be generated. Prefer using the more robust `.openapi-generator-ignore`. | no value, or a comma-separated string of api names |
20
+
| apiDocs | Allows the user to define if api docs will be generated. Prefer using the more robust `.openapi-generator-ignore`. |`true` or `false`|
21
+
| modelDocs | Allows the user to define if model docs will be generated. Prefer using the more robust `.openapi-generator-ignore`. |`true` or `false`|
22
+
| apiTests | Allows the user to define if api tests will be generated. Prefer using the more robust `.openapi-generator-ignore`. |`true` or `false`|
23
+
| modelTests | Allows the user to define if model tests will be generated. Prefer using the more robust `.openapi-generator-ignore`. |`true` or `false`|
24
+
| withXml | Allows the user to control support of XML generated constructs, where supported | none |
25
+
26
+
27
+
## Note on Global Property declaration
28
+
29
+
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+
30
+
31
+
While the examples seen in [Customization](./customization.md) use the Java System Property syntax, keep in mind that the following are equivalent:
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!
0 commit comments