Skip to content

DynamoDbMapper's schema generator does not detect primitive typealiases #1564

@lauzadis

Description

@lauzadis

Describe the bug

Create a class which uses a typealias to a primitive, such as String.

typealias TaskArn = String

@DynamoDbItem
data class MyTypealiasClass(
    @DynamoDbPartitionKey
    val taskArn: TaskArn
)

Try to generate schemas for this class, get an error:

e: [ksp] java.lang.IllegalStateException: Unsupported attribute type TypeRef(pkg=org.example, shortName=TaskArn, genericArgs=[], nullable=false)
        at aws.sdk.kotlin.hll.dynamodbmapper.codegen.annotations.rendering.SchemaRenderer.renderValueConverter(SchemaRenderer.kt:233)
        at aws.sdk.kotlin.hll.dynamodbmapper.codegen.annotations.rendering.SchemaRenderer.renderAttributeDescriptor$lambda$16(SchemaRenderer.kt:163)
...

Regression Issue

  • Select this option if this issue appears to be a regression.

Expected behavior

Schema generator should detect and handle the typealias successfully

Current behavior

Listed above

Steps to Reproduce

Listed above

Possible Solution

No response

Context

No response

AWS SDK for Kotlin version

Any

Platform (JVM/JS/Native)

Any

Operating system and version

Any

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions