Skip to content
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

chore: Update to Smithy 1.49.0 #1515

Merged
merged 3 commits into from
May 22, 2024
Merged

chore: Update to Smithy 1.49.0 #1515

merged 3 commits into from
May 22, 2024

Conversation

jbelkins
Copy link
Contributor

@jbelkins jbelkins commented May 21, 2024

Issue #

#1513

Description of changes

Updates Smithy from 1.47.0 to 1.49.0.

Corresponding smithy-swift PR: smithy-lang/smithy-swift#733

Specific changes:

  • Adds the stringArray type for endpoint params.
  • Adds the ability to create a StaticContextParam endpoint param binding that is typed stringArray.

Two items related to this upgrade have been split into separate issues:

New/existing dependencies impact assessment, if applicable

No new dependencies were added to this change.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@@ -28,7 +28,7 @@ class AWSDeprecatedShapeRemover : SwiftIntegration {
Predicate<Shape> {
val since = it.getTrait<DeprecatedTrait>()?.since?.orElse(null) ?: return@Predicate false
val deprecatedDate = since.toLocalDate() ?: return@Predicate false.also {
println("Failed to parse `since` field $since as a date, skipping removal of deprecated shape $it")
println("Could not parse `since` field \"$since\" as a date, skipping removal of deprecated shape $it")
Copy link
Contributor Author

@jbelkins jbelkins May 21, 2024

Choose a reason for hiding this comment

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

Changed this language because use of the word "failed" makes it difficult to search logs for test failures.

@@ -27,6 +27,7 @@ class EC2QueryProtocolGenerator : AWSHTTPBindingProtocolGenerator(EC2QueryCustom
override val testsToIgnore = setOf(
"SDKAppliedContentEncoding_ec2Query",
"SDKAppendsGzipAndIgnoresHttpProvidedEncoding_ec2Query",
"Ec2EmptyQueryLists",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will fix this test in a separate ticket.
#1514

@@ -25,7 +25,7 @@ class OperationEndpointResolverMiddlewareTests {
guard let region = config.region else {
throw SdkError<GetThingOutputError>.client(ClientError.unknownError(("Missing required parameter: region")))
}
let endpointParams = EndpointParams(boolBar: true, boolBaz: input.fuzz, boolFoo: config.boolFoo, endpoint: config.endpoint, region: region, stringBar: "some value", stringBaz: input.buzz, stringFoo: config.stringFoo)
let endpointParams = EndpointParams(boolBar: true, boolBaz: input.fuzz, boolFoo: config.boolFoo, endpoint: config.endpoint, region: region, stringArrayBar: ["five", "six", "seven"], stringBar: "some value", stringBaz: input.buzz, stringFoo: config.stringFoo)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added a test that code-generates a static param typed to stringArray.

staticContextParam.value.toString()
}
}
swiftParam(param.type, staticContextParam.value)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Refactored this logic to a private method just below.

@@ -61,6 +61,6 @@ fun ParameterType.toShapeType(): ShapeType? {
return when (this) {
ParameterType.STRING -> ShapeType.STRING
ParameterType.BOOLEAN -> ShapeType.BOOLEAN
else -> null
ParameterType.STRING_ARRAY -> ShapeType.LIST
Copy link
Contributor Author

@jbelkins jbelkins May 21, 2024

Choose a reason for hiding this comment

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

Added STRING_ARRAY case and eliminated the else so this fails to compile when the next new ParameterType case is added.

@jbelkins jbelkins marked this pull request as ready for review May 21, 2024 22:27
@jbelkins jbelkins requested review from dayaffe and sichanyoo May 21, 2024 22:41
@jbelkins jbelkins merged commit c7d3891 into main May 22, 2024
29 checks passed
@jbelkins jbelkins deleted the jbe/adopt_smithy_1_49_0 branch May 22, 2024 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants