Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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'
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -166,8 +170,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:
Expand Down Expand Up @@ -199,8 +203,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:
Expand Down
2 changes: 1 addition & 1 deletion Package.version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.164.0
0.168.0
2 changes: 1 addition & 1 deletion Package.version.next
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.165.0
0.169.0
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kotlin.code.style=official
# config

# codegen
smithyVersion=1.62.0
smithyVersion=1.63.0
smithyGradleVersion=0.6.0

# kotlin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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<StreamingTrait>()) {
return
}

val memberName = ctx.symbolProvider.toMemberName(memberShape)
val propertyKey = nodeInfoUtils.nodeInfo(memberShape)
val writingClosure = writingClosureUtils.writingClosure(memberShape)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -26,7 +27,7 @@ class InitialRequestIntegration : SwiftIntegration {
settings: SwiftSettings,
): Boolean {
val service = settings.getService(model)
return service.hasTrait<AwsJson1_0Trait>() || service.hasTrait<AwsJson1_1Trait>()
return service.hasTrait<AwsJson1_0Trait>() || service.hasTrait<AwsJson1_1Trait>() || service.hasTrait<Rpcv2CborTrait>()
}

override fun writeAdditionalFiles(
Expand Down
Loading