diff --git a/smithy-swift-codegen/src/test/kotlin/HttpBodyMiddlewareTests.kt b/smithy-swift-codegen/src/test/kotlin/HttpBodyMiddlewareTests.kt index 5a4bed6d4..0f00c5b67 100644 --- a/smithy-swift-codegen/src/test/kotlin/HttpBodyMiddlewareTests.kt +++ b/smithy-swift-codegen/src/test/kotlin/HttpBodyMiddlewareTests.kt @@ -149,8 +149,8 @@ class HttpBodyMiddlewareTests { Self.Context == H.Context { do { + let encoder = context.getEncoder() if let payload1 = input.operationInput.payload1 { - let encoder = context.getEncoder() let payload1data = try encoder.encode(payload1) let payload1body = ClientRuntime.HttpBody.data(payload1data) input.builder.withBody(payload1body)