Implicit event stream payload members#4535
Merged
ysaito1001 merged 4 commits intomainfrom Feb 13, 2026
Merged
Conversation
ysaito1001
approved these changes
Feb 12, 2026
|
A new generated diff is ready to view.
A new doc preview is ready to view. |
rcoh
approved these changes
Feb 13, 2026
|
A new generated diff is ready to view.
A new doc preview is ready to view. |
|
A new generated diff is ready to view.
A new doc preview is ready to view. |
|
A new generated diff is ready to view.
A new doc preview is ready to view. |
ysaito1001
added a commit
that referenced
this pull request
Feb 16, 2026
## Motivation and Context P382257849 ## Description Changes on the client side: - [x] Remove extra rest json tests that are officially part of Smithy protocol tests in 1.64.0 - [x] Filter out newly added model in `SmithyTypesPubUseExtraTest.kt` that would otherwise defeat the purpose of the test Changes on the server side: - [x] Address errors related to server's constraint types (#4506) - [x] #4535 - [x] #4537 ## Testing - CI ---- _By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice._ --------- Co-authored-by: Fahad Zubair <fahadzubair@gmail.com> Co-authored-by: Fahad Zubair <fahadzub@amazon.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Ownership
payloadMetadata()used operationShape.isInputEventStream(model) to determinetakesOwnershipfor both request and response serializers. For operations where the input has a@streamingevent stream but the output has a non-streaming union payload, the response serializer incorrectly generatedfn(payload: Option<T>) (owned), then passed the owned value to a function expecting&T.For example:
operation DuplexStreamWithDistinctStreams { input: DuplexInput output: DuplexOutput } structure DuplexInput { @httpPayload stream: EventStream // @streaming union } structure DuplexOutput { @httpPayload stream: SingletonStream // non-streaming union }The response serializer checked
isInputEventStream(true, because of EventStream) to decide ownership for the output's SingletonStream, causing a type mismatch in the generated Rust.Fix: Check
isInputEventStreamfor requests andisOutputEventStreamfor responses.Implicit Payload
Per the https://smithy.io/2.0/spec/streaming.html#eventpayload-trait, event struct members with neither
@eventHeadernor@eventPayloadare collectively serialized as a protocol-specific document in the message body. The unmarshaller handled@eventHeaderand@eventPayloadmembers but never parsed the body for these implicit members, leaving their set_* builder methods as dead code (fails with -D warnings).There are three valid member combinations in an event struct:
For case 3, the wire format looks like:
Event stream message headers:
Event stream message body (JSON):
Fix: In the else branch, after handling @eventPayload and @eventHeader members, detect implicit members and parse them from the message body using the existing structure parser into the builder.