Skip to content

[REQ] Add ability to use modelNamePrefix/modelNameSuffix for Kotlin language #1885

@MaksimRT

Description

@MaksimRT

I can't generate Dto models in Kotlin, because it doesn't use modelNamePrefix/modelNameSuffix properties(

Right now I have to use Java models due to this issue.

I use openapi-generator-maven-plugin 3.3.2

Describe the solution you'd like

It is already imlemented in Java. Look at AbstractJavaCodegen.toModelName()

        String nameWithPrefixSuffix = sanitizedName;
        if (!StringUtils.isEmpty(modelNamePrefix)) {
            // add '_' so that model name can be camelized correctly
            nameWithPrefixSuffix = modelNamePrefix + "_" + nameWithPrefixSuffix;
        }

        if (!StringUtils.isEmpty(modelNameSuffix)) {
            // add '_' so that model name can be camelized correctly
            nameWithPrefixSuffix = nameWithPrefixSuffix + "_" + modelNameSuffix;
        }

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