Skip to content

Commit b28af3c

Browse files
authored
fix(smithy-aws-core): omit Result wrapper for empty awsQuery output (#714)
* fix(smithy-aws-core): omit Result wrapper for empty awsQuery output * Add changelog entry * Remove unit test of the fix
1 parent c373a85 commit b28af3c

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type": "bugfix",
3+
"description": "Fixed awsQuery response deserialization for operations with no output members."
4+
}

packages/smithy-aws-core/src/smithy_aws_core/aio/protocols.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -364,10 +364,14 @@ def _action_name(
364364
def _response_wrapper_elements(
365365
self,
366366
operation: APIOperation[SerializeableShape, DeserializeableShape],
367-
) -> tuple[str, str]:
367+
) -> tuple[str, ...]:
368+
name = operation.schema.id.name
369+
# Operations with no output members will omit the <OpResult> element.
370+
if not operation.output_schema.members:
371+
return (f"{name}Response",)
368372
return (
369-
f"{operation.schema.id.name}Response",
370-
f"{operation.schema.id.name}Result",
373+
f"{name}Response",
374+
f"{name}Result",
371375
)
372376

373377
def _error_wrapper_elements(self) -> tuple[str, ...]:

0 commit comments

Comments
 (0)