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/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|
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));
Copy file name to clipboardExpand all lines: modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -238,7 +238,7 @@ public JavaClientCodegen() {
238
238
cliOptions.add(CliOption.newString(MICROPROFILE_REST_CLIENT_VERSION, "Version of MicroProfile Rest Client API."));
239
239
cliOptions.add(CliOption.newString(CodegenConstants.USE_SINGLE_REQUEST_PARAMETER, "Setting this property to \"true\" will generate functions with a single argument containing all API endpoint parameters instead of one argument per parameter. ONLY jersey2, jersey3, okhttp-gson, microprofile, Spring RestClient, Spring WebClient support this option. Setting this property to \"static\" does the same as \"true\", but also makes the generated arguments class static with single parameter instantiation.").defaultValue("false"));
240
240
cliOptions.add(CliOption.newBoolean(WEBCLIENT_BLOCKING_OPERATIONS, "Making all WebClient operations blocking(sync). Note that if on operation 'x-webclient-blocking: false' then such operation won't be sync", this.webclientBlockingOperations));
241
-
cliOptions.add(CliOption.newBoolean(GENERATE_CLIENT_AS_BEAN, "For resttemplate, configure whether to create `ApiClient.java` and Apis clients as bean (with `@Component` annotation).", this.generateClientAsBean));
241
+
cliOptions.add(CliOption.newBoolean(GENERATE_CLIENT_AS_BEAN, "For resttemplate, restclient and webclient, configure whether to create `ApiClient.java` and Apis clients as bean (with `@Component` annotation).", this.generateClientAsBean));
242
242
cliOptions.add(CliOption.newBoolean(SUPPORT_URL_QUERY, "Generate toUrlQueryString in POJO (default to true). Available on `native`, `apache-httpclient` libraries."));
243
243
cliOptions.add(CliOption.newBoolean(USE_ENUM_CASE_INSENSITIVE, "Use `equalsIgnoreCase` when String for enum comparison", useEnumCaseInsensitive));
244
244
cliOptions.add(CliOption.newBoolean(FAIL_ON_UNKNOWN_PROPERTIES, "Fail Jackson de-serialization on unknown properties", this.failOnUnknownProperties));
@@ -1113,7 +1113,7 @@ public ModelsMap postProcessModels(ModelsMap objs) {
0 commit comments