From 8af365aa2ccf68e0ae4012308c4ffb39e197247d Mon Sep 17 00:00:00 2001 From: Aaron J Todd Date: Fri, 12 Nov 2021 11:14:38 -0500 Subject: [PATCH 1/5] preview branch only From 1eebe854a63cea13fa74d81eaae2b3b884fb95ee Mon Sep 17 00:00:00 2001 From: Aaron J Todd Date: Fri, 12 Nov 2021 11:46:51 -0500 Subject: [PATCH 2/5] refactor: remove suspend from inline deserializer --- .../src/main/kotlin/aws/sdk/kotlin/codegen/protocols/RestXml.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codegen/smithy-aws-kotlin-codegen/src/main/kotlin/aws/sdk/kotlin/codegen/protocols/RestXml.kt b/codegen/smithy-aws-kotlin-codegen/src/main/kotlin/aws/sdk/kotlin/codegen/protocols/RestXml.kt index a14955fb41d..5bffdb8bc58 100644 --- a/codegen/smithy-aws-kotlin-codegen/src/main/kotlin/aws/sdk/kotlin/codegen/protocols/RestXml.kt +++ b/codegen/smithy-aws-kotlin-codegen/src/main/kotlin/aws/sdk/kotlin/codegen/protocols/RestXml.kt @@ -174,7 +174,7 @@ open class RestXml : AwsHttpBindingProtocolGenerator() { // in two different contexts val boundMemberName = boundMember.capitalizedDefaultName() val deserializeLambdaIdent = "deserialize$boundMemberName" - writer.withBlock("val $deserializeLambdaIdent = suspend {", "}") { + writer.withBlock("val $deserializeLambdaIdent = {", "}") { write("val builder = #T.builder()", memberSymbol) renderDeserializerBody(ctx, copyWithMemberTraits, targetShape.members().toList(), writer) write("builder.build()") From 8add25d39589392a974cc2da4492cd6268fd95eb Mon Sep 17 00:00:00 2001 From: Aaron J Todd Date: Fri, 12 Nov 2021 12:16:21 -0500 Subject: [PATCH 3/5] more suspend removals and context changes --- .../codegen/customization/glacier/GlacierAccountIdDefault.kt | 2 +- .../s3/internal/GetBucketLocationOperationDeserializer.kt | 2 +- .../aws/sdk/kotlin/services/s3/internal/S3ErrorMetadata.kt | 2 +- .../sdk/kotlin/services/s3/internal/S3ErrorMetadataTest.kt | 5 ++--- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/codegen/smithy-aws-kotlin-codegen/src/main/kotlin/aws/sdk/kotlin/codegen/customization/glacier/GlacierAccountIdDefault.kt b/codegen/smithy-aws-kotlin-codegen/src/main/kotlin/aws/sdk/kotlin/codegen/customization/glacier/GlacierAccountIdDefault.kt index 4356800488f..e603672d5d1 100644 --- a/codegen/smithy-aws-kotlin-codegen/src/main/kotlin/aws/sdk/kotlin/codegen/customization/glacier/GlacierAccountIdDefault.kt +++ b/codegen/smithy-aws-kotlin-codegen/src/main/kotlin/aws/sdk/kotlin/codegen/customization/glacier/GlacierAccountIdDefault.kt @@ -47,7 +47,7 @@ private class GlacierAccountIdMiddleware : ProtocolMiddleware { val accountId = ctx.model.expectShape(op.input.get()).members().first { it.memberName.lowercase() == "accountid" } writer.addImport(RuntimeTypes.Http.Operation.OperationRequest) - writer.withBlock("execution.initialize.intercept { req, next -> ", "}") { + writer.withBlock("op.execution.initialize.intercept { req, next -> ", "}") { openBlock("if (req.subject.#L.isNullOrEmpty()) {", accountId.defaultName()) .write("val updated = req.subject.copy { #L = #S }", accountId.defaultName(), "-") .write("next.call(#T(req.context, updated))", RuntimeTypes.Http.Operation.OperationRequest) diff --git a/services/s3/common/src/aws/sdk/kotlin/services/s3/internal/GetBucketLocationOperationDeserializer.kt b/services/s3/common/src/aws/sdk/kotlin/services/s3/internal/GetBucketLocationOperationDeserializer.kt index 0513f4ec64a..9e75b7a55a2 100644 --- a/services/s3/common/src/aws/sdk/kotlin/services/s3/internal/GetBucketLocationOperationDeserializer.kt +++ b/services/s3/common/src/aws/sdk/kotlin/services/s3/internal/GetBucketLocationOperationDeserializer.kt @@ -28,7 +28,7 @@ internal class GetBucketLocationOperationDeserializer : HttpDeserialize Sender @@ -31,7 +30,7 @@ class S3ErrorDeserializerTest { } @Test - fun `it partially deserializes s3 errors`() = runSuspendTest { + fun `it partially deserializes s3 errors`() { val tests = listOf( """ From e6c5cc93d4b95e902da47ad0dc8ac9c53f01c295 Mon Sep 17 00:00:00 2001 From: Aaron J Todd Date: Fri, 12 Nov 2021 12:47:16 -0500 Subject: [PATCH 4/5] bump smithy-kotlin version to next snapshot --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 00b4882f497..b5e4f0031e1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -13,7 +13,7 @@ sdkVersion=0.9.3-SNAPSHOT smithyVersion=1.13.1 smithyGradleVersion=0.5.3 # smithy-kotlin codegen and runtime are versioned together -smithyKotlinVersion=0.7.1-alpha +smithyKotlinVersion=0.7.2-SNAPSHOT # kotlin kotlinVersion=1.5.31 From 62c204a7bb25048ea98e536970da88ebf6fdcdb0 Mon Sep 17 00:00:00 2001 From: Aaron J Todd Date: Mon, 15 Nov 2021 16:01:54 -0500 Subject: [PATCH 5/5] retry ci