Skip to content

Commit 1a662af

Browse files
Fix warning logs for additional properties that have not been set
1 parent 31089c0 commit 1a662af

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6024,10 +6024,8 @@ protected Map<String, Schema> unaliasPropertySchema(Map<String, Schema> properti
60246024
if (properties != null) {
60256025
for (String key : properties.keySet()) {
60266026
properties.put(key, unaliasSchema(properties.get(key)));
6027-
60286027
}
60296028
}
6030-
60316029
return properties;
60326030
}
60336031

@@ -7093,7 +7091,7 @@ public boolean convertPropertyToBoolean(String propertyKey) {
70937091
} else if (booleanValue instanceof String) {
70947092
result = Boolean.parseBoolean((String) booleanValue);
70957093
} else {
7096-
LOGGER.warn("The value (generator's option) must be either boolean or string. Default to `false`.");
7094+
LOGGER.warn("The value {} must be either boolean or string. Default to `false`.", propertyKey);
70977095
}
70987096
return result;
70997097
}

modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptClientCodegen.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,11 @@ public class TypeScriptClientCodegen extends AbstractTypeScriptClientCodegen imp
8383

8484
private final Map<String, String> frameworkToHttpLibMap;
8585

86+
@Setter
87+
private boolean useRxJS;
88+
@Setter
89+
private boolean useInversify;
90+
8691
// NPM Options
8792
private static final String NPM_REPOSITORY = "npmRepository";
8893

@@ -461,12 +466,12 @@ public void processOpts() {
461466
additionalProperties.put(IMPORT_FILE_EXTENSION_SWITCH, ".ts");
462467
}
463468

464-
final boolean useRxJS = convertPropertyToBooleanAndWriteBack(USE_RXJS_SWITCH);
469+
convertPropertyToBooleanAndWriteBack(USE_RXJS_SWITCH, this::setUseRxJS);
465470
if (!useRxJS) {
466471
supportingFiles.add(new SupportingFile("rxjsStub.mustache", "rxjsStub.ts"));
467472
}
468473

469-
final boolean useInversify = convertPropertyToBooleanAndWriteBack(USE_INVERSIFY_SWITCH);
474+
convertPropertyToBooleanAndWriteBack(USE_INVERSIFY_SWITCH, this::setUseInversify);
470475
if (useInversify) {
471476
supportingFiles.add(new SupportingFile("services" + File.separator + "index.mustache", "services", "index.ts"));
472477
supportingFiles.add(new SupportingFile("services" + File.separator + "configuration.mustache", "services", "configuration.ts"));

modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ public void processOpts() {
313313
}
314314
}
315315

316-
setGenerateValidationAttributes(convertPropertyToBooleanAndWriteBack(VALIDATION_ATTRIBUTES));
316+
convertPropertyToBooleanAndWriteBack(VALIDATION_ATTRIBUTES, this::setGenerateValidationAttributes);
317317
}
318318

319319
@Override

0 commit comments

Comments
 (0)