diff --git a/src/main/kotlin/io/andrewohara/dynamokt/ImmutableDataClassAttribute.kt b/src/main/kotlin/io/andrewohara/dynamokt/ImmutableDataClassAttribute.kt index 9a4d9f4..0368d55 100644 --- a/src/main/kotlin/io/andrewohara/dynamokt/ImmutableDataClassAttribute.kt +++ b/src/main/kotlin/io/andrewohara/dynamokt/ImmutableDataClassAttribute.kt @@ -79,11 +79,11 @@ internal fun KProperty1.toImmutableDataCla dataClass: KClass, schemaCache: MetaTableSchemaCache ): ImmutableAttribute { - val customConverter = findAnnotation() + val converter = findAnnotation() ?.converter ?.let { it as KClass> } ?.let { initConverter(it) } - val converter = customConverter ?: AttributeConverterProvider.defaultProvider().converterFor(returnType.toEnhancedType(schemaCache)) + ?: AttributeConverterProvider.defaultProvider().converterFor(returnType.toEnhancedType(schemaCache)) val dynamoName = findAnnotation()?.name?: name @@ -91,7 +91,7 @@ internal fun KProperty1.toImmutableDataCla .builder( EnhancedType.of(dataClass.java), EnhancedType.of(ImmutableDataClassBuilder::class.java), - customConverter?.type() ?: returnType.toEnhancedType(schemaCache) as EnhancedType + converter.type() as EnhancedType ) .name(dynamoName) .getter(::get)