Skip to content

chore: Update to Smithy 1.49.0 #733

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 22, 2024
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
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.47.0
smithyVersion=1.49.0
smithyGradleVersion=0.6.0

# kotlin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -285,7 +284,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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add STRING_ARRAY case and eliminate the else so this fails to compile when a new ParameterType is added in the future.

}
var builder = Symbol.builder().name(swiftType.fullName)
if (!isRequired) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ object SwiftTypes {
val Double = builtInSymbol("Double")
val Bool = builtInSymbol("Bool")

val StringArray = builtInSymbol("Array<Swift.String>")

val List = builtInSymbol("List")
val Set = builtInSymbol("Set")
val Map = builtInSymbol("Map")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -86,7 +85,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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same change as in AuthSchemeResolverGenerator above.

}
var builder = Symbol.builder().name(swiftType.fullName)
if (!isRequired) {
Expand Down
Loading