From cb84cf4b0109fff6e8b6d0f844552e60840bd625 Mon Sep 17 00:00:00 2001 From: Josh Elkins Date: Mon, 20 May 2024 21:17:32 -0500 Subject: [PATCH 1/2] Update to Smithy 1.49.0 --- gradle.properties | 2 +- .../amazon/smithy/swift/codegen/AuthSchemeResolverGenerator.kt | 2 +- .../kotlin/software/amazon/smithy/swift/codegen/SwiftTypes.kt | 2 ++ .../smithy/swift/codegen/endpoints/EndpointParamsGenerator.kt | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/gradle.properties b/gradle.properties index 5dfb35bec..615f487a3 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,7 +3,7 @@ kotlin.code.style=official # config # codegen -smithyVersion=1.47.0 +smithyVersion=1.49.0 smithyGradleVersion=0.6.0 # kotlin diff --git a/smithy-swift-codegen/src/main/kotlin/software/amazon/smithy/swift/codegen/AuthSchemeResolverGenerator.kt b/smithy-swift-codegen/src/main/kotlin/software/amazon/smithy/swift/codegen/AuthSchemeResolverGenerator.kt index 1ee2a1cb5..5d9c3e4c9 100644 --- a/smithy-swift-codegen/src/main/kotlin/software/amazon/smithy/swift/codegen/AuthSchemeResolverGenerator.kt +++ b/smithy-swift-codegen/src/main/kotlin/software/amazon/smithy/swift/codegen/AuthSchemeResolverGenerator.kt @@ -285,7 +285,7 @@ fun Parameter.toSymbol(): Symbol { val swiftType = when (type) { ParameterType.STRING -> SwiftTypes.String ParameterType.BOOLEAN -> SwiftTypes.Bool - else -> throw CodegenException("Unsupported parameter type: $type") + ParameterType.STRING_ARRAY -> SwiftTypes.StringArray } var builder = Symbol.builder().name(swiftType.fullName) if (!isRequired) { diff --git a/smithy-swift-codegen/src/main/kotlin/software/amazon/smithy/swift/codegen/SwiftTypes.kt b/smithy-swift-codegen/src/main/kotlin/software/amazon/smithy/swift/codegen/SwiftTypes.kt index b4996f1d2..8b693882b 100644 --- a/smithy-swift-codegen/src/main/kotlin/software/amazon/smithy/swift/codegen/SwiftTypes.kt +++ b/smithy-swift-codegen/src/main/kotlin/software/amazon/smithy/swift/codegen/SwiftTypes.kt @@ -16,6 +16,8 @@ object SwiftTypes { val Double = builtInSymbol("Double") val Bool = builtInSymbol("Bool") + val StringArray = builtInSymbol("Array") + val List = builtInSymbol("List") val Set = builtInSymbol("Set") val Map = builtInSymbol("Map") diff --git a/smithy-swift-codegen/src/main/kotlin/software/amazon/smithy/swift/codegen/endpoints/EndpointParamsGenerator.kt b/smithy-swift-codegen/src/main/kotlin/software/amazon/smithy/swift/codegen/endpoints/EndpointParamsGenerator.kt index e22cef456..213b01e46 100644 --- a/smithy-swift-codegen/src/main/kotlin/software/amazon/smithy/swift/codegen/endpoints/EndpointParamsGenerator.kt +++ b/smithy-swift-codegen/src/main/kotlin/software/amazon/smithy/swift/codegen/endpoints/EndpointParamsGenerator.kt @@ -86,7 +86,7 @@ fun Parameter.toSymbol(): Symbol { val swiftType = when (type) { ParameterType.STRING -> SwiftTypes.String ParameterType.BOOLEAN -> SwiftTypes.Bool - else -> throw CodegenException("Unsupported parameter type: $type") + ParameterType.STRING_ARRAY -> SwiftTypes.StringArray } var builder = Symbol.builder().name(swiftType.fullName) if (!isRequired) { From bb36bd8759a94e540d55b9a820f4cd0ce157af43 Mon Sep 17 00:00:00 2001 From: Josh Elkins Date: Tue, 21 May 2024 16:53:45 -0500 Subject: [PATCH 2/2] Fix ktlint --- .../amazon/smithy/swift/codegen/AuthSchemeResolverGenerator.kt | 1 - .../smithy/swift/codegen/endpoints/EndpointParamsGenerator.kt | 1 - 2 files changed, 2 deletions(-) diff --git a/smithy-swift-codegen/src/main/kotlin/software/amazon/smithy/swift/codegen/AuthSchemeResolverGenerator.kt b/smithy-swift-codegen/src/main/kotlin/software/amazon/smithy/swift/codegen/AuthSchemeResolverGenerator.kt index 5d9c3e4c9..3b7f803ef 100644 --- a/smithy-swift-codegen/src/main/kotlin/software/amazon/smithy/swift/codegen/AuthSchemeResolverGenerator.kt +++ b/smithy-swift-codegen/src/main/kotlin/software/amazon/smithy/swift/codegen/AuthSchemeResolverGenerator.kt @@ -3,7 +3,6 @@ package software.amazon.smithy.swift.codegen import software.amazon.smithy.aws.traits.ServiceTrait import software.amazon.smithy.aws.traits.auth.SigV4Trait import software.amazon.smithy.aws.traits.auth.UnsignedPayloadTrait -import software.amazon.smithy.codegen.core.CodegenException import software.amazon.smithy.codegen.core.Symbol import software.amazon.smithy.model.knowledge.ServiceIndex import software.amazon.smithy.model.shapes.OperationShape diff --git a/smithy-swift-codegen/src/main/kotlin/software/amazon/smithy/swift/codegen/endpoints/EndpointParamsGenerator.kt b/smithy-swift-codegen/src/main/kotlin/software/amazon/smithy/swift/codegen/endpoints/EndpointParamsGenerator.kt index 213b01e46..644188ca1 100644 --- a/smithy-swift-codegen/src/main/kotlin/software/amazon/smithy/swift/codegen/endpoints/EndpointParamsGenerator.kt +++ b/smithy-swift-codegen/src/main/kotlin/software/amazon/smithy/swift/codegen/endpoints/EndpointParamsGenerator.kt @@ -5,7 +5,6 @@ package software.amazon.smithy.swift.codegen.endpoints -import software.amazon.smithy.codegen.core.CodegenException import software.amazon.smithy.codegen.core.Symbol import software.amazon.smithy.rulesengine.language.EndpointRuleSet import software.amazon.smithy.rulesengine.language.syntax.parameters.Parameter