-
Notifications
You must be signed in to change notification settings - Fork 29
fix: Don't unwrap unneeded value during event marshal #839
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
Conversation
@@ -27,7 +27,6 @@ class MessageMarshallableGenerator( | |||
) { | |||
internal fun render(streamShape: UnionShape) { | |||
val streamSymbol: Symbol = ctx.symbolProvider.toSymbol(streamShape) | |||
val rootNamespace = ctx.settings.moduleName |
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.
Unused var
@@ -50,10 +49,12 @@ class MessageMarshallableGenerator( | |||
write("switch self {") | |||
streamShape.eventStreamEvents(ctx.model).forEach { member -> | |||
val memberName = ctx.symbolProvider.toMemberName(member) |
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.
The code below is largely just reordered to find all the bindings, then render the right Swift enum case (with or without value
unwrapped), then actually render the bindings.
The if-else
is really the only new code.
.../src/main/kotlin/software/amazon/smithy/swift/codegen/events/MessageMarshallableGenerator.kt
Outdated
Show resolved
Hide resolved
author Josh Elkins <jbelkins@amazon.com> 1725075023 -0500 committer Josh Elkins <jbelkins@amazon.com> 1730244524 -0500 parent 0de1791 author Josh Elkins <jbelkins@amazon.com> 1725075023 -0500 committer Josh Elkins <jbelkins@amazon.com> 1730244464 -0500 parent 0de1791 author Josh Elkins <jbelkins@amazon.com> 1725075023 -0500 committer Josh Elkins <jbelkins@amazon.com> 1730244451 -0500 parent 0de1791 author Josh Elkins <jbelkins@amazon.com> 1725075023 -0500 committer Josh Elkins <jbelkins@amazon.com> 1730244433 -0500 parent 0de1791 author Josh Elkins <jbelkins@amazon.com> 1725075023 -0500 committer Josh Elkins <jbelkins@amazon.com> 1730244416 -0500 parent 0de1791 author Josh Elkins <jbelkins@amazon.com> 1725075023 -0500 committer Josh Elkins <jbelkins@amazon.com> 1730244397 -0500 parent 0de1791 author Josh Elkins <jbelkins@amazon.com> 1725075023 -0500 committer Josh Elkins <jbelkins@amazon.com> 1730244381 -0500 parent 0de1791 author Josh Elkins <jbelkins@amazon.com> 1725075023 -0500 committer Josh Elkins <jbelkins@amazon.com> 1730244297 -0500 parent 0de1791 author Josh Elkins <jbelkins@amazon.com> 1725075023 -0500 committer Josh Elkins <jbelkins@amazon.com> 1730244277 -0500 WIP chore: Organize codegen tests & Kotlin unit tests (#830) * Organize codegen tests & refactor setup tests for XML codegen tests to reduce duplicate code. * ktlint --------- Co-authored-by: Sichan Yoo <chanyoo@amazon.com> feat: Make models Sendable (#829) chore: Specify Xcode_16 application name same as on Github runner (#831) chore: Move HTTP status code test out of SmithyTestUtil (#836) chore: Protocol tests set their own AWS credentials (#837) Don't import Darwin on Windows. (#835) chore: Run macOS 15 with Xcode 16 on CI (#838) fix: Don't unwrap unneeded value during event marshal (#839) fix: Don't supply a default value when reading a non-optional value (#840) feat: Enable sigv4a for SESv2 service (#842) feat!: Bump CRT version to 0.37.0 & add CRC64NVME checksum algorithm wrapper (#845) * Bump CRT version to 0.37.0 and add wrapper for new checksum algorithm. * Add doc comment re: checksum algorithms may expand in future. --------- Co-authored-by: Sichan Yoo <chanyoo@amazon.com> chore: Use Smithy 1.52.1 (#846) feat: Smoke Tests V2 (#841) * Basic scaffold. * Add SmokeTestGenerator for generic Smithy spec, with customization points via open functions. * Refactor both codegen logic and generated code to fix runtime / compile errors in generated code. * Generate test runner only if there's >=1 test case(s) for the service. Narrow down imports to specific class used. * Add manual ignore lists for disabling codegen for smoke tests by their test ID or their test tag. * Add generic codegen for smoke tests * Rename variables to be more specific. --------- Co-authored-by: Sichan Yoo <chanyoo@amazon.com> chore: Updates version to 0.86.0
Description of changes
Quiets a warning that occurs when an event to be marshalled is unwrapped but not accessed.
Also adds some comments to help clear up what's going on in the
marshal
generated code.Scope
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.