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

elasticbeanstalk model generates invalid enum #403

Closed
kggilmer opened this issue Jun 11, 2021 · 2 comments
Closed

elasticbeanstalk model generates invalid enum #403

kggilmer opened this issue Jun 11, 2021 · 2 comments
Assignees
Labels
bug This issue is a bug. codegen Codegen related change
Milestone

Comments

@kggilmer
Copy link
Contributor

When testing the single-phase build branch, I found that elasticbeanstalk generates an enum type with name collisions.

Shape from model: https://github.com/awslabs/aws-sdk-kotlin/blob/88a469e20503e7763439789a31621a8d17c3b72c/codegen/sdk/aws-models/elasticbeanstalk.2010-12-01.json#L1230-L1244

Codegen output:

// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.elasticbeanstalk.model



sealed class ConfigurationOptionValueType {

    abstract val value: kotlin.String

    object List : aws.sdk.kotlin.services.elasticbeanstalk.model.ConfigurationOptionValueType() {
        override val value: kotlin.String = "List"
        override fun toString(): kotlin.String = value
    }

    object Scalar : aws.sdk.kotlin.services.elasticbeanstalk.model.ConfigurationOptionValueType() {
        override val value: kotlin.String = "Scalar"
        override fun toString(): kotlin.String = value
    }

    data class SdkUnknown(override val value: kotlin.String) : aws.sdk.kotlin.services.elasticbeanstalk.model.ConfigurationOptionValueType() {
        override fun toString(): kotlin.String = value
    }

    companion object {
        /**
         * Convert a raw value to one of the sealed variants or [SdkUnknown]
         */
        fun fromValue(str: kotlin.String): aws.sdk.kotlin.services.elasticbeanstalk.model.ConfigurationOptionValueType = when(str) {
            "List" -> List
            "Scalar" -> Scalar
            else -> SdkUnknown(str)
        }

        /**
         * Get a list of all possible variants
         */
        fun values(): List<aws.sdk.kotlin.services.elasticbeanstalk.model.ConfigurationOptionValueType> = listOf(
            List,
            Scalar
        )
    }
}

Error:

e: ...aws-sdk-kotlin/services/elasticbeanstalk/generated-src/main/kotlin/aws/sdk/kotlin/services/elasticbeanstalk/model/ConfigurationOptionValueType.kt: (38, 27): No type arguments expected for object List
@kggilmer kggilmer added bug This issue is a bug. codegen Codegen related change labels Jun 11, 2021
@kggilmer
Copy link
Contributor Author

Related to #116

kggilmer added a commit that referenced this issue Jun 16, 2021
@kggilmer kggilmer added this to the M2 milestone Jun 16, 2021
@kggilmer kggilmer self-assigned this Jun 16, 2021
@kggilmer
Copy link
Contributor Author

Fixed in M2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. codegen Codegen related change
Projects
None yet
Development

No branches or pull requests

1 participant