Skip to content

[Kotlin] enums should be uppercase #7466

@kennetvu

Description

@kennetvu
Description

In Kotlin enums should be uppercased, its not directly a rule in Kotlin to have enums in uppercase but all examples used in Kotlin documentation is uppercased.

See here https://kotlinlang.org/docs/reference/coding-conventions.html#property-names and https://kotlinlang.org/docs/reference/enum-classes.html

Swagger-codegen version

2.3.1

Steps to reproduce

I dupliacted integrationtests for scala in /swagger-codegen/modules/swagger-codegen/src/test/resources/integrationtests/scala and created kotlin test, and then I ran /swagger-codegen/modules/swagger-codegen/src/test/resources/integrationtests/kotlin/required-attributes.sh

Related issues/PRs

Related to #5769

Suggest a fix/enhancement
protected CodegenConstants.ENUM_PROPERTY_NAMING_TYPE enumPropertyNaming = CodegenConstants.ENUM_PROPERTY_NAMING_TYPE.camelCase;

in KotlinClientCodegen.java should be changed to

protected CodegenConstants.ENUM_PROPERTY_NAMING_TYPE enumPropertyNaming = CodegenConstants.ENUM_PROPERTY_NAMING_TYPE.UPPERCASE;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions