Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REQ] Avoid warning in typescript client generator #20485

Open
SimoneDalka opened this issue Jan 16, 2025 · 0 comments
Open

[REQ] Avoid warning in typescript client generator #20485

SimoneDalka opened this issue Jan 16, 2025 · 0 comments

Comments

@SimoneDalka
Copy link

SimoneDalka commented Jan 16, 2025

When I try to generate a typescript client setting only --input-spec and --output parameters, openapi-generator-cli prompts a warning with the following message:

[main] WARN  o.o.codegen.DefaultCodegen - The value (generator's option) must be either boolean or string. Default to `false`.

Describe the solution you'd like

Check if the supportsES6 additional property is present before trying to set it inside processOpts() method of AbstractTypeScriptClientCodegen class:

if (additionalProperties.containsKey(CodegenConstants.SUPPORTS_ES6)) {
    setSupportsES6(convertPropertyToBooleanAndWriteBack(CodegenConstants.SUPPORTS_ES6));
}

or

convertPropertyToBooleanAndWriteBack(CodegenConstants.SUPPORTS_ES6, this::setSupportsES6);

Describe alternatives you've considered

In order to make the warning disappear, I have to explicitly set supportsES6 additional property:

openapi-generator-cli generate -g typescript-angular [...] -p supportsES6=false

Additional context

The warning is produced by convertPropertyToBooleanAndWriteBack method inside setSupportsES6 setter:

@SimoneDalka SimoneDalka changed the title [REQ] Avoid wanring in typescript client generator [REQ] Avoid warning in typescript client generator Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant