Skip to content

[BUG] [core] CodegenConfigurator not applying all GeneratorSettings #6128

@chameleon82

Description

@chameleon82

Bug Report Checklist

I trying to apply custom GeneratorSettings, but get only default ones. For example with "scala-akka" template i got next:

          CodegenConfigurator configurator = new CodegenConfigurator()
          configurator.setGeneratorName("scala-akka")
          configurator.setPackageName("some.package")
          configurator.setApiPackage("some.package.api")
          configurator.setInvokerPackage("some.package.core")
          configurator.setModelPackage("some.package.model")

          ClientOptInput clientOptOutput = configurator.toClientOptInput

and the result is present with default values instead of defined explicitly

          clientOptOutput.getPackageName // this property not present at all
          clientOptOutput.getApiPackage = "org.openapitools.client.api"
          clientOptOutput.getInvokerPackage ="org.openapitools.client.core"
          clientOptOutput.getModelPackage = "org.openapitools.client.model"

Seems code can be improved here:

// TODO: Work toward CodegenConfig having a "GeneratorSettings" property.

Next step to generate files is (which is obviously generating un-expecting result):

    DefaultGenerator codeGenerator = new DefaultGenerator
    codeGenerator.opts(opts).generate()

Should we cover those properties in CodegenConfigurator or there is another way to solve it?

Upd:
Those properties converted to additionalProperties. Is it make sense to have those properties available for DefaultCodegen as a class properties or any specific reason to keep it in additionalProperties?

@jimschubert (2017/09) ❤️, @wing328 , @Helmsdown , @jmini

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions