Skip to content

Commit d5e1a45

Browse files
authored
chore: remove @ExperimentalApi annotations from DDB Mapper APIs (#1742)
1 parent 7ba127c commit d5e1a45

File tree

82 files changed

+11
-315
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+11
-315
lines changed

hll/build.gradle.kts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ val sdkVersion: String by project
2727
val libraries = libs
2828

2929
val optinAnnotations = listOf(
30-
"aws.smithy.kotlin.runtime.ExperimentalApi",
3130
"aws.smithy.kotlin.runtime.InternalApi",
3231
"aws.sdk.kotlin.runtime.InternalSdkApi",
3332
"kotlin.RequiresOptIn",

hll/dynamodb-mapper/dynamodb-mapper-ops-codegen/src/main/kotlin/aws/sdk/kotlin/hll/dynamodbmapper/codegen/operations/rendering/DataTypeGenerator.kt

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,14 @@
55
package aws.sdk.kotlin.hll.dynamodbmapper.codegen.operations.rendering
66

77
import aws.sdk.kotlin.hll.codegen.core.CodeGenerator
8-
import aws.sdk.kotlin.hll.codegen.model.*
9-
import aws.sdk.kotlin.hll.codegen.rendering.*
8+
import aws.sdk.kotlin.hll.codegen.model.Member
9+
import aws.sdk.kotlin.hll.codegen.model.Structure
10+
import aws.sdk.kotlin.hll.codegen.model.asParamsList
11+
import aws.sdk.kotlin.hll.codegen.model.genericVars
12+
import aws.sdk.kotlin.hll.codegen.rendering.BuilderRenderer
13+
import aws.sdk.kotlin.hll.codegen.rendering.RenderContext
14+
import aws.sdk.kotlin.hll.codegen.rendering.RenderOptions
15+
import aws.sdk.kotlin.hll.codegen.rendering.Visibility
1016
import aws.sdk.kotlin.hll.codegen.util.plus
1117

1218
/**
@@ -60,9 +66,7 @@ internal class DataTypeGenerator(
6066
private val structure: Structure,
6167
) : CodeGenerator by generator {
6268
fun generate() {
63-
write("@#T", Types.Smithy.ExperimentalApi)
6469
withBlock("public interface #T {", "}", structure.type) {
65-
write("@#T", Types.Smithy.ExperimentalApi)
6670
write("public companion object { }") // leave room for future expansion
6771
blankLine()
6872
members { write("public val #L: #T", name, type) }
@@ -85,7 +89,6 @@ internal class DataTypeGenerator(
8589
BuilderRenderer(this, structure.type, implType, structure.members, builderCtx).render()
8690

8791
blankLine()
88-
write("@#T", Types.Smithy.ExperimentalApi)
8992
withBlock(
9093
"public fun #1L#2T.toBuilder(): #3L#4L = #3L#4L().apply {",
9194
"}",
@@ -98,7 +101,6 @@ internal class DataTypeGenerator(
98101
}
99102

100103
blankLine()
101-
write("@#T", Types.Smithy.ExperimentalApi)
102104
withBlock(
103105
"public fun #1L#2T.copy(block: #3L#4L.() -> Unit): #2T =",
104106
"",
@@ -111,7 +113,6 @@ internal class DataTypeGenerator(
111113
}
112114

113115
blankLine()
114-
write("@#T", Types.Smithy.ExperimentalApi)
115116
withBlock(
116117
"public fun #L#L(block: #L#L.() -> Unit): #T =",
117118
"",

hll/dynamodb-mapper/dynamodb-mapper-ops-codegen/src/main/kotlin/aws/sdk/kotlin/hll/dynamodbmapper/codegen/operations/rendering/OperationsTypeRenderer.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ internal class OperationsTypeRenderer(
105105
write("operations after mapping objects to items and vice versa")
106106
write("@param T The type of objects which will be read from and/or written to this #L", entityName)
107107
}
108-
write("@#T", Types.Smithy.ExperimentalApi)
109108
writeInline("public interface #T ", interfaceType)
110109

111110
parentType?.let { writeInline(": #T ", parentType) }

hll/dynamodb-mapper/dynamodb-mapper-ops-codegen/src/main/kotlin/aws/sdk/kotlin/hll/dynamodbmapper/codegen/operations/rendering/PaginatorRenderer.kt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ internal class PaginatorRenderer(
112112

113113
private fun renderItemsPaginator() {
114114
val jvmName = "${op.methodName}${paginationInfo.items.name.capitalizeFirstChar}"
115-
write("@#T", Types.Smithy.ExperimentalApi)
116115
write("@#T(#S)", Types.Kotlin.Jvm.JvmName, jvmName)
117116
withBlock("public fun <T> #T.items(): #T =", "", pageFlowType, itemFlowType) {
118117
withBlock("#T { page ->", "}", Types.Kotlinx.Coroutines.Flow.transform) {
@@ -124,7 +123,6 @@ internal class PaginatorRenderer(
124123
}
125124

126125
private fun renderPaginatorWithDsl() {
127-
write("@#T", Types.Smithy.ExperimentalApi)
128126
writeInline("public inline fun <T> ")
129127

130128
extensionOf?.let { writeInline("#T.", extensionOf) }
@@ -141,7 +139,6 @@ internal class PaginatorRenderer(
141139
}
142140

143141
private fun renderPaginatorWithRequest() {
144-
write("@#T", Types.Smithy.ExperimentalApi)
145142
writeInline("public fun <T> ")
146143

147144
extensionOf?.let { writeInline("#T.", extensionOf) }

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ internal class SchemaRenderer(
111111
}
112112

113113
private fun renderItemConverter() {
114-
write("@#T", Types.Smithy.ExperimentalApi)
115114
withBlock("#Lobject #L : #T by #T(", ")", ctx.attributes.visibility, converterName, MapperTypes.Items.itemConverter(classType), MapperTypes.Items.SimpleItemConverter) {
116115
if (shouldRenderBuilder) {
117116
write("builderFactory = ::#L,", builderName)
@@ -136,7 +135,6 @@ internal class SchemaRenderer(
136135
*/
137136
private fun renderValueConverter() {
138137
// TODO Offer alternate serialization options besides AttributeValue.M?
139-
write("@#T", Types.Smithy.ExperimentalApi)
140138
write(
141139
"#Lval #L : #T = #T.#T(#T)",
142140
ctx.attributes.visibility,
@@ -291,7 +289,6 @@ internal class SchemaRenderer(
291289
MapperTypes.Items.itemSchemaPartitionKey(classType, partitionKeyProp.typeRef)
292290
}
293291

294-
write("@#T", Types.Smithy.ExperimentalApi)
295292
withBlock("#Lobject #L : #T {", "}", ctx.attributes.visibility, schemaName, schemaType) {
296293
write("override val converter: #1T = #1T", itemConverter)
297294
write("override val partitionKey: #T = #T(#S)", MapperTypes.Items.keySpec(partitionKeyProp.keySpec), partitionKeyProp.keySpecType, partitionKeyName)
@@ -322,7 +319,6 @@ internal class SchemaRenderer(
322319
docs("Returns a reference to a table named [name] containing items representing [#T]", classType)
323320

324321
val fnName = "get${className}Table"
325-
write("@#T", Types.Smithy.ExperimentalApi)
326322
write(
327323
"#Lfun #T.#L(name: String): #T = #L(name, #L)",
328324
ctx.attributes.visibility,

hll/dynamodb-mapper/dynamodb-mapper-schema-generator-plugin/src/main/kotlin/aws/sdk/kotlin/hll/dynamodbmapper/plugins/SchemaGeneratorPlugin.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,12 @@ package aws.sdk.kotlin.hll.dynamodbmapper.plugins
66

77
import aws.sdk.kotlin.hll.codegen.rendering.RenderOptions
88
import aws.sdk.kotlin.hll.dynamodbmapper.codegen.annotations.AnnotationsProcessorOptions
9-
import aws.smithy.kotlin.runtime.ExperimentalApi
109
import com.google.devtools.ksp.gradle.KspExtension
1110
import org.gradle.api.Plugin
1211
import org.gradle.api.Project
1312
import org.gradle.kotlin.dsl.configure
1413
import org.gradle.kotlin.dsl.create
1514

16-
@ExperimentalApi
1715
public class SchemaGeneratorPlugin : Plugin<Project> {
1816
override fun apply(project: Project): Unit = project.run {
1917
val extension = createExtension()

hll/dynamodb-mapper/dynamodb-mapper-schema-generator-plugin/src/main/kotlin/aws/sdk/kotlin/hll/dynamodbmapper/plugins/SchemaGeneratorPluginExtension.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,9 @@ package aws.sdk.kotlin.hll.dynamodbmapper.plugins
88
import aws.sdk.kotlin.hll.codegen.rendering.Visibility
99
import aws.sdk.kotlin.hll.dynamodbmapper.codegen.annotations.DestinationPackage
1010
import aws.sdk.kotlin.hll.dynamodbmapper.codegen.annotations.GenerateBuilderClasses
11-
import aws.smithy.kotlin.runtime.ExperimentalApi
1211

1312
internal const val SCHEMA_GENERATOR_PLUGIN_EXTENSION = "dynamoDbMapper"
1413

15-
@ExperimentalApi
1614
public open class SchemaGeneratorPluginExtension {
1715
/**
1816
* Determines when a builder class should be generated for user classes. Defaults to "WHEN_REQUIRED".

hll/dynamodb-mapper/dynamodb-mapper-schema-generator-plugin/src/test/kotlin/aws/sdk/kotlin/hll/dynamodbmapper/plugins/SchemaGeneratorPluginTest.kt

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -207,9 +207,7 @@ class SchemaGeneratorPluginTest {
207207
fun testGenerateBuilderOption() {
208208
val pluginConfiguration = """
209209
import aws.sdk.kotlin.hll.dynamodbmapper.codegen.annotations.GenerateBuilderClasses
210-
import aws.smithy.kotlin.runtime.ExperimentalApi
211210
212-
@OptIn(ExperimentalApi::class)
213211
dynamoDbMapper {
214212
generateBuilderClasses = GenerateBuilderClasses.ALWAYS
215213
}
@@ -240,9 +238,7 @@ class SchemaGeneratorPluginTest {
240238
fun testVisibilityOption() {
241239
val pluginConfiguration = """
242240
import aws.sdk.kotlin.hll.codegen.rendering.Visibility
243-
import aws.smithy.kotlin.runtime.ExperimentalApi
244241
245-
@OptIn(ExperimentalApi::class)
246242
dynamoDbMapper {
247243
visibility = Visibility.INTERNAL
248244
}
@@ -270,9 +266,6 @@ class SchemaGeneratorPluginTest {
270266
@Test
271267
fun testGenerateGetTableFunctionOption() {
272268
val pluginConfiguration = """
273-
import aws.smithy.kotlin.runtime.ExperimentalApi
274-
275-
@OptIn(ExperimentalApi::class)
276269
dynamoDbMapper {
277270
generateGetTableExtension = false
278271
}
@@ -301,9 +294,7 @@ class SchemaGeneratorPluginTest {
301294
fun testRelativeDestinationPackage() {
302295
val pluginConfiguration = """
303296
import aws.sdk.kotlin.hll.dynamodbmapper.codegen.annotations.DestinationPackage
304-
import aws.smithy.kotlin.runtime.ExperimentalApi
305297
306-
@OptIn(ExperimentalApi::class)
307298
dynamoDbMapper {
308299
destinationPackage = DestinationPackage.Relative("hello.moto")
309300
}
@@ -328,9 +319,7 @@ class SchemaGeneratorPluginTest {
328319
fun testAbsoluteDestinationPackage() {
329320
val pluginConfiguration = """
330321
import aws.sdk.kotlin.hll.dynamodbmapper.codegen.annotations.DestinationPackage
331-
import aws.smithy.kotlin.runtime.ExperimentalApi
332322
333-
@OptIn(ExperimentalApi::class)
334323
dynamoDbMapper {
335324
destinationPackage = DestinationPackage.Absolute("absolutely.my.`package`")
336325
}

hll/dynamodb-mapper/dynamodb-mapper-schema-generator-plugin/src/test/resources/custom-item-converter/CustomItemConverter.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,8 @@ import aws.sdk.kotlin.hll.dynamodbmapper.items.ItemConverter
1010
import aws.sdk.kotlin.hll.dynamodbmapper.items.SimpleItemConverter
1111
import aws.sdk.kotlin.hll.dynamodbmapper.values.scalars.NumberValueConverters
1212
import aws.sdk.kotlin.hll.dynamodbmapper.values.scalars.StringValueConverter
13-
import aws.smithy.kotlin.runtime.ExperimentalApi
1413
import org.example.CustomUser
1514

16-
@OptIn(ExperimentalApi::class)
1715
public object MyCustomUserConverter : ItemConverter<CustomUser> by SimpleItemConverter(
1816
builderFactory = { CustomUser() },
1917
build = { this },

hll/dynamodb-mapper/dynamodb-mapper-schema-generator-plugin/src/test/resources/standard-item-converters/test/ListsTest.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,10 @@
44
*/
55
package org.example
66

7-
import aws.smithy.kotlin.runtime.ExperimentalApi
87
import org.example.dynamodbmapper.generatedschemas.ListsConverter
98
import kotlin.test.Test
109
import kotlin.test.assertEquals
1110

12-
@OptIn(ExperimentalApi::class)
1311
public class ListsTest {
1412
@Test
1513
fun converterTest() {

0 commit comments

Comments
 (0)