Skip to content

Properly handle event payload members of blob and string type#1064

Merged
sugmanue merged 3 commits intosmithy-lang:mainfrom
sugmanue:sugmanue/fix-event-stream-encoding
Mar 12, 2026
Merged

Properly handle event payload members of blob and string type#1064
sugmanue merged 3 commits intosmithy-lang:mainfrom
sugmanue:sugmanue/fix-event-stream-encoding

Conversation

@sugmanue
Copy link
Contributor

@sugmanue sugmanue commented Mar 12, 2026

Issue #, if available:

Description of changes:

Properly handle event payload members of blob and string type, those are serialized directly into the event payload using a different content-type header.

Serializes a member with the trait @eventPayload directly into the payload of the event. The following member types have special handling:

  • blob For blob members the non-encoded bytes are the payload of the event and the event :content-type header is set to "application/octet-stream"
  • string For string members the UTF-8 encoded bytes are the payload of the event and the event :content-type header is set to "text/plain"
  • If the payload is empty, no :content-type is added as header of the message
  • Any other is encoded with the underlying protocol and uses the content type defined for it, unless

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

@sugmanue sugmanue enabled auto-merge (squash) March 12, 2026 01:09
@sugmanue sugmanue merged commit efb7a93 into smithy-lang:main Mar 12, 2026
2 checks passed
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.

3 participants