Skip to content

DynamoDbMapper's schema generation for nullable lists not working #1590

@sb000003

Description

@sb000003

Describe the bug

Hi,

Unsure if this is intended behavior or not. When i have a data class with a property like this for e.g. val keywords: List<String>? = null it generates a schema that won't compile with the error Inapplicable candidate(s): val keywords: List<String>?.

It seems it doesn't matter what the Type in the list is, it will produce the incorrect schema. Here is what got generated in my specific example.

AttributeDescriptor( "keywords", Player::keywords, PlayerBuilder::keywords::set, ListConverter(StringConverter), )

I think the converter there maybe needs to be NullableConverter(ListConverter(StringConverter)), instead?

Regression Issue

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

Expected behavior

The generated schema compiles when a nullable list property is included.

Current behavior

An error Inapplicable candidate(s): val keywords: List<String>?

Steps to Reproduce

Have an annotated data class with a nullable list property like e.g. val keywords: List<String>? = null

Possible Solution

No response

Context

No response

AWS SDK for Kotlin version

1.4.61-beta

Platform (JVM/JS/Native)

JVM

Operating system and version

MACOS Sequoia 15.4 (24E248)

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