Skip to content

Commit cca5234

Browse files
Serialize payload content types correctly
1 parent 0865337 commit cca5234

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

python-packages/aws-event-stream/aws_event_stream/_private/serializers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ def begin_struct(self, schema: "Schema") -> Iterator[ShapeSerializer]:
147147
def _get_payload_member(self, schema: Schema) -> Schema | None:
148148
for member in schema.members.values():
149149
if EVENT_PAYLOAD_TRAIT in member.traits:
150-
return schema
150+
return member
151151
return None
152152

153153
def _get_payload_media_type(self, schema: Schema, default: str) -> str:

python-packages/aws-event-stream/tests/unit/_private/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ def _consumer(schema: Schema, de: ShapeDeserializer) -> None:
526526
":message-type": "event",
527527
":event-type": "payload",
528528
"header": "header",
529-
":content-type": "application/json",
529+
":content-type": "text/plain",
530530
},
531531
payload=b'"payload"',
532532
),

0 commit comments

Comments
 (0)