From 2322b1c82fce2fd6202b355c643f71f1cc882beb Mon Sep 17 00:00:00 2001 From: Chan <55515281+sichanyoo@users.noreply.github.com> Date: Tue, 14 Oct 2025 15:41:37 -0700 Subject: [PATCH 1/9] fix: Ignore input event stream member when encoding input shape (#981) * Ignore input event stream member when encoding input shape. * Fix ktlint. --------- Co-authored-by: Sichan Yoo --- .../kotlin/software/amazon/smithy/swift/codegen/Utils.kt | 8 +++++++- .../serde/member/MemberShapeEncodeGenerator.kt | 9 +++++++++ .../swiftintegrations/InitialRequestIntegration.kt | 3 ++- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/smithy-swift-codegen/src/main/kotlin/software/amazon/smithy/swift/codegen/Utils.kt b/smithy-swift-codegen/src/main/kotlin/software/amazon/smithy/swift/codegen/Utils.kt index 440914a17..30d7190b6 100644 --- a/smithy-swift-codegen/src/main/kotlin/software/amazon/smithy/swift/codegen/Utils.kt +++ b/smithy-swift-codegen/src/main/kotlin/software/amazon/smithy/swift/codegen/Utils.kt @@ -7,6 +7,7 @@ package software.amazon.smithy.swift.codegen import software.amazon.smithy.aws.traits.protocols.AwsJson1_0Trait import software.amazon.smithy.aws.traits.protocols.AwsJson1_1Trait import software.amazon.smithy.model.shapes.ShapeId +import software.amazon.smithy.protocol.traits.Rpcv2CborTrait import software.amazon.smithy.swift.codegen.lang.reservedWords import software.amazon.smithy.utils.CaseUtils @@ -35,4 +36,9 @@ fun swiftEnumCaseName( return enumCaseName } -fun supportsStreamingAndIsRPC(protocolID: ShapeId): Boolean = arrayOf(AwsJson1_0Trait.ID, AwsJson1_1Trait.ID).contains(protocolID) +fun supportsStreamingAndIsRPC(protocolID: ShapeId): Boolean = + arrayOf( + AwsJson1_0Trait.ID, + AwsJson1_1Trait.ID, + Rpcv2CborTrait.ID, + ).contains(protocolID) diff --git a/smithy-swift-codegen/src/main/kotlin/software/amazon/smithy/swift/codegen/integration/serde/member/MemberShapeEncodeGenerator.kt b/smithy-swift-codegen/src/main/kotlin/software/amazon/smithy/swift/codegen/integration/serde/member/MemberShapeEncodeGenerator.kt index 8d21473ce..592fce731 100644 --- a/smithy-swift-codegen/src/main/kotlin/software/amazon/smithy/swift/codegen/integration/serde/member/MemberShapeEncodeGenerator.kt +++ b/smithy-swift-codegen/src/main/kotlin/software/amazon/smithy/swift/codegen/integration/serde/member/MemberShapeEncodeGenerator.kt @@ -11,6 +11,7 @@ import software.amazon.smithy.model.shapes.StructureShape import software.amazon.smithy.model.shapes.TimestampShape import software.amazon.smithy.model.shapes.UnionShape import software.amazon.smithy.model.traits.SparseTrait +import software.amazon.smithy.model.traits.StreamingTrait import software.amazon.smithy.model.traits.TimestampFormatTrait import software.amazon.smithy.model.traits.XmlFlattenedTrait import software.amazon.smithy.swift.codegen.SwiftWriter @@ -68,6 +69,14 @@ abstract class MemberShapeEncodeGenerator( memberShape: MemberShape, prefix: String, ) { + // If member shape is a event streaming member (union with streaming trait), + // we must ignore it when encoding input struct. + // The event streaming member will be set as body via EventStreamBodyMiddleware. + val targetShape = ctx.model.expectShape(memberShape.target) + if (targetShape is UnionShape && targetShape.hasTrait()) { + return + } + val memberName = ctx.symbolProvider.toMemberName(memberShape) val propertyKey = nodeInfoUtils.nodeInfo(memberShape) val writingClosure = writingClosureUtils.writingClosure(memberShape) diff --git a/smithy-swift-codegen/src/main/kotlin/software/amazon/smithy/swift/codegen/swiftintegrations/InitialRequestIntegration.kt b/smithy-swift-codegen/src/main/kotlin/software/amazon/smithy/swift/codegen/swiftintegrations/InitialRequestIntegration.kt index 3427bf23d..e9729f0dc 100644 --- a/smithy-swift-codegen/src/main/kotlin/software/amazon/smithy/swift/codegen/swiftintegrations/InitialRequestIntegration.kt +++ b/smithy-swift-codegen/src/main/kotlin/software/amazon/smithy/swift/codegen/swiftintegrations/InitialRequestIntegration.kt @@ -7,6 +7,7 @@ import software.amazon.smithy.model.Model import software.amazon.smithy.model.knowledge.EventStreamIndex import software.amazon.smithy.model.knowledge.TopDownIndex import software.amazon.smithy.model.shapes.StructureShape +import software.amazon.smithy.protocol.traits.Rpcv2CborTrait import software.amazon.smithy.swift.codegen.SwiftDelegator import software.amazon.smithy.swift.codegen.SwiftSettings import software.amazon.smithy.swift.codegen.core.SwiftCodegenContext @@ -26,7 +27,7 @@ class InitialRequestIntegration : SwiftIntegration { settings: SwiftSettings, ): Boolean { val service = settings.getService(model) - return service.hasTrait() || service.hasTrait() + return service.hasTrait() || service.hasTrait() || service.hasTrait() } override fun writeAdditionalFiles( From 4ac5f40b807d767884596f085215209af194a146 Mon Sep 17 00:00:00 2001 From: AWS SDK Swift Automation Date: Wed, 15 Oct 2025 18:20:02 +0000 Subject: [PATCH 2/9] chore: Updates version to 0.165.0 --- Package.version | 2 +- Package.version.next | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Package.version b/Package.version index 1a1a8b1ac..7df908678 100644 --- a/Package.version +++ b/Package.version @@ -1 +1 @@ -0.164.0 \ No newline at end of file +0.165.0 \ No newline at end of file diff --git a/Package.version.next b/Package.version.next index 7df908678..80285cda4 100644 --- a/Package.version.next +++ b/Package.version.next @@ -1 +1 @@ -0.165.0 \ No newline at end of file +0.166.0 \ No newline at end of file From 54a97f2d2a1ce5323cd80e955e8977c139cdc707 Mon Sep 17 00:00:00 2001 From: Josh Elkins Date: Thu, 23 Oct 2025 16:50:37 -0500 Subject: [PATCH 3/9] chore: Update Smithy to 1.63.0 (#985) --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 13e0cdb01..0bbd4b39b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,7 +3,7 @@ kotlin.code.style=official # config # codegen -smithyVersion=1.62.0 +smithyVersion=1.63.0 smithyGradleVersion=0.6.0 # kotlin From ba500f1996c5970b014c6ee5f8c52e5b0b8e86eb Mon Sep 17 00:00:00 2001 From: Josh Elkins Date: Thu, 23 Oct 2025 17:23:28 -0500 Subject: [PATCH 4/9] chore: Run CI on Ubuntu jammy & noble (#982) --- .github/workflows/continuous-integration.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 4ef355683..f156f6b2e 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -166,8 +166,8 @@ jobs: - ubuntu-24.04 - ubuntu-24.04-arm swift: - - 5.9-focal - - 6.2-jammy + - 5.9-jammy + - 6.2-noble container: image: swift:${{ matrix.swift }} env: @@ -199,8 +199,8 @@ jobs: - ubuntu-24.04 - ubuntu-24.04-arm swift: - - 5.9-focal - - 6.2-jammy + - 5.9-jammy + - 6.2-noble container: image: swift:${{ matrix.swift }} env: From 6b0f48b291fdeceef861d8900306706336b56fdc Mon Sep 17 00:00:00 2001 From: AWS SDK Swift Automation Date: Fri, 24 Oct 2025 18:14:40 +0000 Subject: [PATCH 5/9] chore: Updates version to 0.166.0 --- Package.version | 2 +- Package.version.next | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Package.version b/Package.version index 7df908678..80285cda4 100644 --- a/Package.version +++ b/Package.version @@ -1 +1 @@ -0.165.0 \ No newline at end of file +0.166.0 \ No newline at end of file diff --git a/Package.version.next b/Package.version.next index 80285cda4..58fa24f21 100644 --- a/Package.version.next +++ b/Package.version.next @@ -1 +1 @@ -0.166.0 \ No newline at end of file +0.167.0 \ No newline at end of file From b1601f237cb20189af35e2813886c4a166307c0f Mon Sep 17 00:00:00 2001 From: Josh Elkins Date: Fri, 24 Oct 2025 15:23:49 -0500 Subject: [PATCH 6/9] chore: Add customization point for client protocol, version property (#983) --- .../codegen/integration/HttpProtocolServiceClient.kt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/smithy-swift-codegen/src/main/kotlin/software/amazon/smithy/swift/codegen/integration/HttpProtocolServiceClient.kt b/smithy-swift-codegen/src/main/kotlin/software/amazon/smithy/swift/codegen/integration/HttpProtocolServiceClient.kt index 1c54c21c9..99ba1847e 100644 --- a/smithy-swift-codegen/src/main/kotlin/software/amazon/smithy/swift/codegen/integration/HttpProtocolServiceClient.kt +++ b/smithy-swift-codegen/src/main/kotlin/software/amazon/smithy/swift/codegen/integration/HttpProtocolServiceClient.kt @@ -22,15 +22,17 @@ open class HttpProtocolServiceClient( ) { private val serviceName: String = ctx.settings.sdkId + open val clientProtocolSymbol: Symbol = ClientRuntimeTypes.Core.Client + fun render(serviceSymbol: Symbol) { writer.openBlock( "${ctx.settings.visibility} class \$L: \$N {", "}", serviceSymbol.name, - ClientRuntimeTypes.Core.Client, + clientProtocolSymbol, ) { writer.write("public static let clientName = \$S", serviceSymbol.name) - writer.write("public static let version = \$S", ctx.settings.moduleVersion) + renderVersionProperty() writer.write("let client: \$N", ClientRuntimeTypes.Http.SdkHttpClient) writer.write("let config: \$L", serviceConfig.typeName) writer.write("let serviceName = \$S", serviceName) @@ -44,6 +46,10 @@ open class HttpProtocolServiceClient( renderServiceSpecificPlugins() } + open fun renderVersionProperty() { + writer.write("public static let version = \$S", ctx.settings.moduleVersion) + } + open fun renderInitFunction() { writer.openBlock("public required init(config: \$L) {", "}", serviceConfig.typeName) { writer.write( From 10266e5783c07f3fd79685c1653f75e2248ec998 Mon Sep 17 00:00:00 2001 From: AWS SDK Swift Automation Date: Mon, 27 Oct 2025 18:23:50 +0000 Subject: [PATCH 7/9] chore: Updates version to 0.167.0 --- Package.version | 2 +- Package.version.next | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Package.version b/Package.version index 80285cda4..58fa24f21 100644 --- a/Package.version +++ b/Package.version @@ -1 +1 @@ -0.166.0 \ No newline at end of file +0.167.0 \ No newline at end of file diff --git a/Package.version.next b/Package.version.next index 58fa24f21..06cc9779a 100644 --- a/Package.version.next +++ b/Package.version.next @@ -1 +1 @@ -0.167.0 \ No newline at end of file +0.168.0 \ No newline at end of file From 5cf3686afda81b789ef0fbb5ed4473be4edf5441 Mon Sep 17 00:00:00 2001 From: Josh Elkins Date: Tue, 28 Oct 2025 10:24:02 -0500 Subject: [PATCH 8/9] chore: Use iOS sim 26.0.1 in CI (#986) --- .github/workflows/continuous-integration.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index f156f6b2e..015b69d6e 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -25,7 +25,7 @@ jobs: - Xcode_26.0 destination: - 'platform=iOS Simulator,OS=17.2,name=iPhone 15' - - 'platform=iOS Simulator,OS=26.0,name=iPhone 17' + - 'platform=iOS Simulator,OS=26.0.1,name=iPhone 17' - 'platform=tvOS Simulator,OS=17.2,name=Apple TV 4K (3rd generation) (at 1080p)' - 'platform=tvOS Simulator,OS=26.0,name=Apple TV 4K (3rd generation) (at 1080p)' - 'platform=visionOS Simulator,OS=1.0,name=Apple Vision Pro' @@ -48,7 +48,7 @@ jobs: # Don't run new simulators with old Xcode - destination: 'platform=tvOS Simulator,OS=26.0,name=Apple TV 4K (3rd generation) (at 1080p)' xcode: Xcode_15.2 - - destination: 'platform=iOS Simulator,OS=26.0,name=iPhone 17' + - destination: 'platform=iOS Simulator,OS=26.0.1,name=iPhone 17' xcode: Xcode_15.2 - destination: 'platform=visionOS Simulator,OS=26.0,name=Apple Vision Pro' xcode: Xcode_15.2 @@ -61,6 +61,8 @@ jobs: uses: actions/checkout@v4 - name: Setup common tools uses: ./.github/actions/setup-common-tools-composite-action + - name: List all sims installed + run: xcrun simctl list - name: Build & Run smithy-swift Kotlin Unit Tests run: ./gradlew build - name: Build & Run smithy-swift Swift Unit Tests @@ -88,7 +90,7 @@ jobs: - Xcode_26.0 destination: - 'platform=iOS Simulator,OS=17.2,name=iPhone 15' - - 'platform=iOS Simulator,OS=26.0,name=iPhone 17' + - 'platform=iOS Simulator,OS=26.0.1,name=iPhone 17' - 'platform=tvOS Simulator,OS=17.2,name=Apple TV 4K (3rd generation) (at 1080p)' - 'platform=tvOS Simulator,OS=26.0,name=Apple TV 4K (3rd generation) (at 1080p)' - 'platform=visionOS Simulator,OS=1.0,name=Apple Vision Pro' @@ -111,7 +113,7 @@ jobs: # Don't run new simulators with old Xcode - destination: 'platform=tvOS Simulator,OS=26.0,name=Apple TV 4K (3rd generation) (at 1080p)' xcode: Xcode_15.2 - - destination: 'platform=iOS Simulator,OS=26.0,name=iPhone 17' + - destination: 'platform=iOS Simulator,OS=26.0.1,name=iPhone 17' xcode: Xcode_15.2 - destination: 'platform=visionOS Simulator,OS=26.0,name=Apple Vision Pro' xcode: Xcode_15.2 @@ -133,6 +135,8 @@ jobs: uses: ./smithy-swift/.github/actions/setup-common-tools-composite-action - name: Tools Versions run: ./aws-sdk-swift/scripts/ci_steps/log_tool_versions.sh + - name: List all sims installed + run: xcrun simctl list - name: Prepare aws-sdk-swift Protocol & Unit Tests run: | cd aws-sdk-swift From 825beae9be4a2518f457a4930d8969dc598d8c0c Mon Sep 17 00:00:00 2001 From: AWS SDK Swift Automation Date: Tue, 28 Oct 2025 18:23:26 +0000 Subject: [PATCH 9/9] chore: Updates version to 0.168.0 --- Package.version | 2 +- Package.version.next | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Package.version b/Package.version index 58fa24f21..06cc9779a 100644 --- a/Package.version +++ b/Package.version @@ -1 +1 @@ -0.167.0 \ No newline at end of file +0.168.0 \ No newline at end of file diff --git a/Package.version.next b/Package.version.next index 06cc9779a..306cba6c0 100644 --- a/Package.version.next +++ b/Package.version.next @@ -1 +1 @@ -0.168.0 \ No newline at end of file +0.169.0 \ No newline at end of file