Bug Report Checklist
Description
#21269 introduces a new global additionalProperty: defaultToEmptyContainer
Unfortunately it only works when using additionalProperties.
It does not work with configOptions in maven. The plugin requires cliOptions. See
|
for (CliOption langCliOption : config.cliOptions()) { |
openapi-generator version
7.14.0
Steps to reproduce
Configure maven
<configOptions>
<defaultToEmptyContainer>array|undefined</defaultToEmptyContainer>
</configOptions>
Related issues/PRs
#21269
Suggest a fix
Add cliOptions to the supported generators (maybe all by default?)
cliOptions.add(CliOption.newString(DEFAULT_TO_EMPTY_CONTAINER, "description..."));
Update CodeGenMojo to put all configOptions to additionalProperties:
if (configOptions != null) {
for (Map.Entry<?, ?> configOptionsEntry : configOptions.entrySet()) {
input.getConfig().additionalProperties().put(configOptionsEntry.getKey().toString(), configOptionsEntry.getValue());
}
}
Bug Report Checklist
Description
#21269 introduces a new global additionalProperty: defaultToEmptyContainer
Unfortunately it only works when using additionalProperties.
It does not work with configOptions in maven. The plugin requires cliOptions. See
openapi-generator/modules/openapi-generator-maven-plugin/src/main/java/org/openapitools/codegen/plugin/CodeGenMojo.java
Line 976 in e948355
openapi-generator version
7.14.0
Steps to reproduce
Configure maven
Related issues/PRs
#21269
Suggest a fix
Add cliOptions to the supported generators (maybe all by default?)
Update CodeGenMojo to put all configOptions to additionalProperties: