-
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe 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. |
||
SmithyTypes.ByteStream, | ||
FoundationTypes.Data | ||
) | ||
} | ||
} else { | ||
{ writer -> | ||
writer.format("\$N(\"$literal\".utf8)", FoundationTypes.Data) | ||
writer.format("\$N(base64Encoded: \"$literal\")", FoundationTypes.Data) | ||
} | ||
} | ||
) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. Same fixes here: decode the blob default string from base64 before using. |
||
SmithyTypes.ByteStream, | ||
FoundationTypes.Data | ||
FoundationTypes.Data, | ||
value, | ||
) | ||
} else { | ||
writer.format( | ||
" ?? \$N(\"$value\".utf8)", | ||
FoundationTypes.Data | ||
" ?? \$N(base64Encoded: \$S)", | ||
FoundationTypes.Data, | ||
value, | ||
) | ||
} | ||
} | ||
|
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.