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

Idempotency tokens should be ignored when applied to a nested shape #1128

Open
ianbotsf opened this issue Jul 25, 2024 · 0 comments
Open

Idempotency tokens should be ignored when applied to a nested shape #1128

ianbotsf opened this issue Jul 25, 2024 · 0 comments
Labels
bug This issue is a bug.

Comments

@ianbotsf
Copy link
Contributor

Describe the bug

Given a model:

operation Foo {
    input := {
        bar: Bar
    }
}

structure Bar {
    @idempotencyToken
    dedpue: String
}

The generated serializer code incorrectly assumes that a context: ExecutionContext value is in scope when attempting to serialize the request. The problem is likely in SerializeStructGenerator.idempotencyTokenPostfix.

Instead, according to Smithy's trait documentation, we should be silently ignoring the trait whenever we encounter it applied to a member of a non-top-level, non-input shape. (This "desired behavior" seems incorrect, confirming with Smithy team.)

Expected behavior

Idempotency tokens should be ignored when applied to a nested or non-input shape

Current behavior

Codegen incorrectly generates serialization code for nested idempotency tokens, causing compilation to fail

Steps to Reproduce

See model above

Possible Solution

No response

Context

No response

Smithy-Kotlin version

1.2.18

Platform (JVM/JS/Native)

JVM

Operating system and version

(n/a)

@ianbotsf ianbotsf added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jul 25, 2024
@ianbotsf ianbotsf removed the needs-triage This issue or PR still needs to be triaged. label Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug.
Projects
None yet
Development

No branches or pull requests

1 participant