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
+23-5Lines changed: 23 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -504,7 +504,7 @@ Another useful option is `inlineSchemaOptions`, which allows you to customize ho
504
504
- `MAP_ITEM_SUFFIX` set the map item suffix
505
505
- `SKIP_SCHEMA_REUSE=true` is a special value to skip reusing inline schemas during refactoring
506
506
- `REFACTOR_ALLOF_INLINE_SCHEMAS=true` will restore the 6.x (or below) behaviour to refactor allOf inline schemas into $ref. (v7.0.0 will skip the refactoring of these allOf inline schemas by default)
507
-
- `RESOLVE_INLINE_ENUMS=true` will refactor inline enum definitions into $ref
507
+
- `RESOLVE_INLINE_ENUMS=true` will refactor inline enum definitions into $ref. This must be activated to allow the renaming of inline enum definitions using `inlineSchemaMappings`.
- `FILTER`: When set to `operationId:addPet|getPetById` for example, it will add `x-internal:true` to operations with operationId not equal to addPet/getPetById (which will have x-internal set to false) so that these operations marked as internal won't be generated.
The `FILTER` parameter allows selective inclusion of API operations based on specific criteria. It applies the `x-internal: true` property to operations that do **not** match the specified values, preventing them from being generated.
607
+
608
+
### Available Filters
609
+
610
+
- **`operationId`**
611
+
When set to `operationId:addPet|getPetById`, operations **not** matching `addPet` or `getPetById` will be marked as internal (`x-internal: true`), and excluded from generation. Matching operations will have `x-internal: false`.
612
+
613
+
- **`method`**
614
+
When set to `method:get|post`, operations **not** using `GET` or `POST` methods will be marked as internal (`x-internal: true`), preventing their generation.
615
+
616
+
- **`tag`**
617
+
When set to `tag:person|basic`, operations **not** tagged with `person` or `basic` will be marked as internal (`x-internal: true`), and will not be generated.
Copy file name to clipboardExpand all lines: docs/generators/csharp.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -54,6 +54,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
54
54
|useIntForTimeout|Use int for Timeout (fall back to v7.9.0 templates). This option (for restsharp only) will be deprecated so please migrated to TimeSpan instead.||false|
55
55
|useOneOfDiscriminatorLookup|Use the discriminator's mapping in oneOf to speed up the model lookup. IMPORTANT: Validation (e.g. one and only one match in oneOf's schemas) will be skipped.||false|
56
56
|useSourceGeneration|Use source generation where available (only `generichost` library supports this option).||false|
57
+
|useVirtualForHooks|Generate code that exposes public virtual hooks on ApiClient to customize low-level HTTP requests (only `restsharp`. `httpclient` libraries support this option).||false|
|zeroBasedEnums|Enumerations with string values will start from 0 when true, 1 when false. If not set, enumerations with string values will start from 0 if the first value is 'unknown', case insensitive.||null|
Copy file name to clipboardExpand all lines: docs/generators/java-microprofile.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -52,7 +52,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
52
52
|errorObjectType|Error Object type. (This option is for okhttp-gson only)||null|
53
53
|failOnUnknownProperties|Fail Jackson de-serialization on unknown properties||false|
54
54
|generateBuilders|Whether to generate builders for models||false|
55
-
|generateClientAsBean|For resttemplate, configure whether to create `ApiClient.java` and Apis clients as bean (with `@Component` annotation).||false|
55
+
|generateClientAsBean|For resttemplate, restclient and webclient, configure whether to create `ApiClient.java` and Apis clients as bean (with `@Component` annotation).||false|
56
56
|generateConstructorWithAllArgs|whether to generate a constructor for all arguments||false|
57
57
|gradleProperties|Append additional Gradle properties to the gradle.properties file||null|
58
58
|groupId|groupId in generated pom.xml||org.openapitools|
Copy file name to clipboardExpand all lines: docs/generators/java.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -52,7 +52,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
52
52
|errorObjectType|Error Object type. (This option is for okhttp-gson only)||null|
53
53
|failOnUnknownProperties|Fail Jackson de-serialization on unknown properties||false|
54
54
|generateBuilders|Whether to generate builders for models||false|
55
-
|generateClientAsBean|For resttemplate, configure whether to create `ApiClient.java` and Apis clients as bean (with `@Component` annotation).||false|
55
+
|generateClientAsBean|For resttemplate, restclient and webclient, configure whether to create `ApiClient.java` and Apis clients as bean (with `@Component` annotation).||false|
56
56
|generateConstructorWithAllArgs|whether to generate a constructor for all arguments||false|
57
57
|gradleProperties|Append additional Gradle properties to the gradle.properties file||null|
58
58
|groupId|groupId in generated pom.xml||org.openapitools|
publicstaticfinalStringUSE_VIRTUAL_FOR_HOOKS_DESC = "Generate code that exposes public virtual hooks on ApiClient to customize low-level HTTP requests (only `restsharp`. `httpclient` libraries support this option).";
if (filterStrs.length != 2) { // only support operationId with : at the moment
241
-
LOGGER.error("FILTER rule must be in the form of `operationId:name1|name2|name3`: {}", inputRules.get(FILTER));
245
+
LOGGER.error("FILTER rule must be in the form of `operationId:name1|name2|name3` or `method:get|post|put` or `tag:tag1|tag2|tag3`: {}", inputRules.get(FILTER));
LOGGER.error("FILTER rule must be in the form of `operationId:name1|name2|name3`: {}", inputRules.get(FILTER));
263
+
LOGGER.error("FILTER rule must be in the form of `operationId:name1|name2|name3` or `method:get|post|put` or `tag:tag1|tag2|tag3`: {}", inputRules.get(FILTER));
// Iterates over each HTTP method in methodMap, retrieves the corresponding Operation from the PathItem,
367
+
// and marks it as internal (`x-internal`) if the method is not in methodFilters.
368
+
methodMap.forEach((method, getter) -> {
369
+
Operationoperation = getter.apply(path);
370
+
if (operation != null && !methodFilters.isEmpty()) {
371
+
LOGGER.info("operation `{}` marked internal only (x-internal: `{}`) by the method FILTER", operation.getOperationId(), !methodFilters.contains(method));
0 commit comments