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

Fix event stream :content-type for struct messages #3603

Merged
merged 5 commits into from
Apr 27, 2024

Conversation

jdisanti
Copy link
Collaborator

@jdisanti jdisanti commented Apr 25, 2024

Event stream operations with struct shaped messages were using the wrong :content-type message header value, which I think wasn't caught before since the supported AWS S3/Transcribe event stream operations don't serialize struct messages. This PR fixes the message content type serialization.


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@jdisanti jdisanti marked this pull request as ready for review April 25, 2024 22:25
@jdisanti jdisanti requested review from a team as code owners April 25, 2024 22:25
Copy link

A new generated diff is ready to view.

A new doc preview is ready to view.

Copy link

A new generated diff is ready to view.

A new doc preview is ready to view.

fun eventStreamMemberContentType(
model: Model,
memberShape: MemberShape,
protocolContentType: String?,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Just wondering, why do we even allow this to be a nullable string? In the end, we are going to through an exception in any case.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some protocols don't support event streams, for example, awsQuery/ec2Query. There isn't a sane value to set here for those.



[[smithy-rs]]
message = "Fix event stream `:content-type` message headers for struct messages."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: It would be nice if we could also write something that clarifies that the initial content-type for event stream messages differs from the content type for each frame.

@rcoh
Copy link
Collaborator

rcoh commented Apr 26, 2024

You may want to target the release branch with this PR

@jdisanti jdisanti enabled auto-merge April 26, 2024 22:41
Copy link

A new generated diff is ready to view.

A new doc preview is ready to view.

@jdisanti jdisanti added this pull request to the merge queue Apr 26, 2024
Merged via the queue into main with commit eac52eb Apr 27, 2024
44 checks passed
@jdisanti jdisanti deleted the jdisanti-eventstream-content-type-fix branch April 27, 2024 00:05
ogghead pushed a commit to ogghead/smithy-rs that referenced this pull request May 5, 2024
Event stream operations with struct shaped messages were using the wrong
`:content-type` message header value, which I think wasn't caught before
since the supported AWS S3/Transcribe event stream operations don't
serialize struct messages. This PR fixes the message content type
serialization.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants