diff --git a/codegen/smithy-aws-kotlin-codegen/src/main/kotlin/aws/sdk/kotlin/codegen/AwsServiceConfigIntegration.kt b/codegen/smithy-aws-kotlin-codegen/src/main/kotlin/aws/sdk/kotlin/codegen/AwsServiceConfigIntegration.kt index ca4e1251700..9b4a7f81fda 100644 --- a/codegen/smithy-aws-kotlin-codegen/src/main/kotlin/aws/sdk/kotlin/codegen/AwsServiceConfigIntegration.kt +++ b/codegen/smithy-aws-kotlin-codegen/src/main/kotlin/aws/sdk/kotlin/codegen/AwsServiceConfigIntegration.kt @@ -9,8 +9,8 @@ import software.amazon.smithy.kotlin.codegen.integration.KotlinIntegration import software.amazon.smithy.kotlin.codegen.integration.SectionWriterBinding import software.amazon.smithy.kotlin.codegen.lang.KotlinTypes import software.amazon.smithy.kotlin.codegen.model.asNullable -import software.amazon.smithy.kotlin.codegen.model.boxed import software.amazon.smithy.kotlin.codegen.model.knowledge.AwsSignatureVersion4 +import software.amazon.smithy.kotlin.codegen.model.nullable import software.amazon.smithy.kotlin.codegen.rendering.* import software.amazon.smithy.kotlin.codegen.rendering.util.ConfigProperty import software.amazon.smithy.kotlin.codegen.rendering.util.ConfigPropertyType @@ -22,7 +22,7 @@ class AwsServiceConfigIntegration : KotlinIntegration { companion object { val RegionProp: ConfigProperty = ConfigProperty { name = "region" - symbol = KotlinTypes.String.toBuilder().boxed().build() + symbol = KotlinTypes.String.toBuilder().nullable().build() baseClass = AwsRuntimeTypes.Core.Client.AwsSdkClientConfig useNestedBuilderBaseClass() documentation = """ diff --git a/codegen/smithy-aws-kotlin-codegen/src/main/kotlin/aws/sdk/kotlin/codegen/protocols/eventstream/EventStreamParserGenerator.kt b/codegen/smithy-aws-kotlin-codegen/src/main/kotlin/aws/sdk/kotlin/codegen/protocols/eventstream/EventStreamParserGenerator.kt index 142da61844a..45f86311712 100644 --- a/codegen/smithy-aws-kotlin-codegen/src/main/kotlin/aws/sdk/kotlin/codegen/protocols/eventstream/EventStreamParserGenerator.kt +++ b/codegen/smithy-aws-kotlin-codegen/src/main/kotlin/aws/sdk/kotlin/codegen/protocols/eventstream/EventStreamParserGenerator.kt @@ -137,7 +137,7 @@ class EventStreamParserGenerator( else -> throw CodegenException("unsupported eventHeader shape: member=$hdrBinding; targetShape=$target") } - val defaultValuePostfix = if (targetSymbol.isNotBoxed && targetSymbol.defaultValue() != null) { + val defaultValuePostfix = if (targetSymbol.isNotNullable && targetSymbol.defaultValue() != null) { " ?: ${targetSymbol.defaultValue()}" } else { "" diff --git a/codegen/smithy-aws-kotlin-codegen/src/test/kotlin/aws/sdk/kotlin/codegen/customization/BoxServicesTest.kt b/codegen/smithy-aws-kotlin-codegen/src/test/kotlin/aws/sdk/kotlin/codegen/customization/BoxServicesTest.kt index d465e68b2c4..43a1b1898c3 100644 --- a/codegen/smithy-aws-kotlin-codegen/src/test/kotlin/aws/sdk/kotlin/codegen/customization/BoxServicesTest.kt +++ b/codegen/smithy-aws-kotlin-codegen/src/test/kotlin/aws/sdk/kotlin/codegen/customization/BoxServicesTest.kt @@ -40,7 +40,7 @@ class BoxServicesTest { structure Other {} integer NotBoxedField - """.prependNamespaceAndService(operations = listOf("Foo")).toSmithyModel() + """.prependNamespaceAndService(version = "1", operations = listOf("Foo")).toSmithyModel() val ctx = model.newTestContext() val transformed = BoxServices().preprocessModel(model, ctx.generationCtx.settings) diff --git a/codegen/smithy-aws-kotlin-codegen/src/test/kotlin/aws/sdk/kotlin/codegen/customization/RemoveEventStreamOperationsTest.kt b/codegen/smithy-aws-kotlin-codegen/src/test/kotlin/aws/sdk/kotlin/codegen/customization/RemoveEventStreamOperationsTest.kt index 9dc1a78bf9c..fb0926788ef 100644 --- a/codegen/smithy-aws-kotlin-codegen/src/test/kotlin/aws/sdk/kotlin/codegen/customization/RemoveEventStreamOperationsTest.kt +++ b/codegen/smithy-aws-kotlin-codegen/src/test/kotlin/aws/sdk/kotlin/codegen/customization/RemoveEventStreamOperationsTest.kt @@ -23,6 +23,7 @@ class RemoveEventStreamOperationsTest { input: BlobInput } structure BlobInput { + @required blob: StreamingBlob } @streaming