Skip to content

Commit 817022f

Browse files
authored
For query protocols ignore the body if the output schema has the unit type trait (#1173)
Some services such as Neptune's AddTagsToResourceResponse operation that targets `smithy.api#Unit` for its output still returns the `ResponseMetadata` in the payload. This change ignores the response when the operation output targes Unit. See example of output below. ``` <AddTagsToResourceResponse xmlns="http://rds.amazonaws.com/doc/2014-10-31/"> <ResponseMetadata> <RequestId>abc-123</RequestId> </ResponseMetadata> </AddTagsToResourceResponse ```
1 parent ecd86e3 commit 817022f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

aws/client/aws-client-awsquery/src/main/java/software/amazon/smithy/java/aws/client/awsquery/AwsQueryClientProtocol.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public <I extends SerializableStruct, O extends SerializableStruct> O deserializ
102102
var builder = operation.outputBuilder();
103103
var content = response.body();
104104

105-
if (content.contentLength() == 0) {
105+
if (content.contentLength() == 0 || operation.outputSchema().hasTrait(TraitKey.UNIT_TYPE_TRAIT)) {
106106
return builder.build();
107107
}
108108

0 commit comments

Comments
 (0)