-
Notifications
You must be signed in to change notification settings - Fork 30
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.53.0 #866
Conversation
@@ -380,14 +380,14 @@ class SwiftSymbolProvider(private val model: Model, val swiftSettings: SwiftSett | |||
if (shape.hasTrait<StreamingTrait>()) { | |||
{ writer -> | |||
writer.format( | |||
"\$N.data(\$N(\"$literal\".utf8))", | |||
"\$N.data(\$N(base64Encoded: \"$literal\"))", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Smithy blob default values are always base64-encoded strings so the default is decoded here.
writer.writeInline(".stream(\$N(data: ", SmithyStreamsTypes.Core.BufferedStream) | ||
".data(using: .utf8)!, isClosed: true))" | ||
writer.writeInline(".stream(\$N(data: \$N(", SmithyStreamsTypes.Core.BufferedStream, FoundationTypes.Data) | ||
".utf8), isClosed: true))" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A little code cleanup & converted to using Swift string's utf8 view to create data.
@@ -243,14 +243,16 @@ open class MemberShapeDecodeGenerator( | |||
writer.addImport(FoundationTypes.Data) | |||
return if (targetShape.hasTrait<StreamingTrait>()) { | |||
writer.format( | |||
" ?? \$N.data(\$N(\"$value\".utf8))", | |||
" ?? \$N.data(\$N(base64Encoded: \$S))", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same fixes here: decode the blob default string from base64 before using.
Description of changes
Updates to Smithy 1.53.0.
Fixes a couple code-generated default values to decode Base64 blob defaults before using them.
Scope
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.