Skip to content

Commit 8dd69b9

Browse files
committed
revert
1 parent 39a1920 commit 8dd69b9

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

hll/dynamodb-mapper/dynamodb-mapper-annotations/common/src/aws/sdk/kotlin/hll/dynamodbmapper/Annotations.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ public annotation class DynamoDbAttribute(val name: String)
2323
* If not set, one will be automatically generated.
2424
*/
2525
@Target(AnnotationTarget.CLASS)
26-
public annotation class DynamoDbItem(val converter: KClass<*> = UnspecifiedItemConverter::class)
26+
// FIXME Update to take a KClass<out ItemConverter<*>> once KSP bug is fixed
27+
// https://github.com/google/ksp/issues/1129
28+
public annotation class DynamoDbItem(val converterName: String)
2729

2830
//@InternalSdkApi
2931
public object UnspecifiedItemConverter: ItemConverter<Item> {

hll/dynamodb-mapper/dynamodb-mapper-schema-codegen/src/main/kotlin/aws/sdk/kotlin/hll/dynamodbmapper/codegen/annotations/rendering/HighLevelRenderer.kt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,9 @@ package aws.sdk.kotlin.hll.dynamodbmapper.codegen.annotations.rendering
77
import aws.sdk.kotlin.hll.codegen.core.CodeGeneratorFactory
88
import aws.sdk.kotlin.hll.codegen.rendering.RenderContext
99
import aws.sdk.kotlin.hll.codegen.util.plus
10-
import aws.sdk.kotlin.hll.dynamodbmapper.DynamoDbItem
1110
import aws.sdk.kotlin.hll.dynamodbmapper.codegen.annotations.AnnotationsProcessorOptions
1211
import aws.sdk.kotlin.hll.dynamodbmapper.codegen.annotations.DestinationPackage
1312
import aws.smithy.kotlin.runtime.collections.*
14-
import com.google.devtools.ksp.KspExperimental
15-
import com.google.devtools.ksp.getAnnotationsByType
1613
import com.google.devtools.ksp.processing.KSPLogger
1714
import com.google.devtools.ksp.symbol.KSClassDeclaration
1815

hll/dynamodb-mapper/dynamodb-mapper-schema-codegen/src/main/kotlin/aws/sdk/kotlin/hll/dynamodbmapper/codegen/annotations/rendering/SchemaRenderer.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ internal class SchemaRenderer(
4545
}
4646

4747
private val itemConverter: Type = dynamoDbItemAnnotation
48-
.takeIf { it.converter != UnspecifiedItemConverter::class }
48+
.converterName
49+
.takeIf { it.isNotBlank() }
4950
?.let {
50-
val fullName = checkNotNull(it.converter.qualifiedName) { "DynamoDbItem converter qualified name is unexpectedly null" }
51-
val pkg = fullName.substringBeforeLast(".")
52-
val shortName = fullName.removePrefix("$pkg.")
51+
val pkg = it.substringBeforeLast(".")
52+
val shortName = it.removePrefix("$pkg.")
5353
TypeRef(pkg, shortName)
5454
} ?: TypeRef(ctx.pkg, converterName)
5555

@@ -89,7 +89,7 @@ internal class SchemaRenderer(
8989
renderBuilder()
9090
}
9191

92-
if (dynamoDbItemAnnotation.converter == UnspecifiedItemConverter::class) {
92+
if (dynamoDbItemAnnotation.converterName.isBlank()) {
9393
renderItemConverter()
9494
}
9595

0 commit comments

Comments
 (0)