[Typescript] Fix warning logs for additional properties that have not been set (#21630)

* Fix warning logs for additional properties that have not been set

* Readd warning log details to clarify what option that the log refers to
This commit is contained in:
Mattias Sehlstedt 2025-08-16 07:15:25 +02:00 committed by GitHub
parent fe5305f2cf
commit 6c31cbbf47
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 9 additions and 6 deletions

View File

@ -6028,10 +6028,8 @@ public class DefaultCodegen implements CodegenConfig {
if (properties != null) {
for (String key : properties.keySet()) {
properties.put(key, unaliasSchema(properties.get(key)));
}
}
return properties;
}
@ -7097,7 +7095,7 @@ public class DefaultCodegen implements CodegenConfig {
} else if (booleanValue instanceof String) {
result = Boolean.parseBoolean((String) booleanValue);
} else {
LOGGER.warn("The value (generator's option) must be either boolean or string. Default to `false`.");
LOGGER.warn("The generator's option \"{}\" must be either boolean or string. Default to `false`.", propertyKey);
}
return result;
}

View File

@ -83,6 +83,11 @@ public class TypeScriptClientCodegen extends AbstractTypeScriptClientCodegen imp
private final Map<String, String> frameworkToHttpLibMap;
@Setter
private boolean useRxJS;
@Setter
private boolean useInversify;
// NPM Options
private static final String NPM_REPOSITORY = "npmRepository";
@ -461,12 +466,12 @@ public class TypeScriptClientCodegen extends AbstractTypeScriptClientCodegen imp
additionalProperties.put(IMPORT_FILE_EXTENSION_SWITCH, ".ts");
}
final boolean useRxJS = convertPropertyToBooleanAndWriteBack(USE_RXJS_SWITCH);
convertPropertyToBooleanAndWriteBack(USE_RXJS_SWITCH, this::setUseRxJS);
if (!useRxJS) {
supportingFiles.add(new SupportingFile("rxjsStub.mustache", "rxjsStub.ts"));
}
final boolean useInversify = convertPropertyToBooleanAndWriteBack(USE_INVERSIFY_SWITCH);
convertPropertyToBooleanAndWriteBack(USE_INVERSIFY_SWITCH, this::setUseInversify);
if (useInversify) {
supportingFiles.add(new SupportingFile("services" + File.separator + "index.mustache", "services", "index.ts"));
supportingFiles.add(new SupportingFile("services" + File.separator + "configuration.mustache", "services", "configuration.ts"));

View File

@ -313,7 +313,7 @@ public class TypeScriptFetchClientCodegen extends AbstractTypeScriptClientCodege
}
}
setGenerateValidationAttributes(convertPropertyToBooleanAndWriteBack(VALIDATION_ATTRIBUTES));
convertPropertyToBooleanAndWriteBack(VALIDATION_ATTRIBUTES, this::setGenerateValidationAttributes);
}
@Override