Skip to content

Commit

Permalink
codegen: Update AwsQuery and JSONRPC protocols to skip empty inputs
Browse files Browse the repository at this point in the history
Updates the AwsQuery and JSONPRC protocols to skip serializing inputs
with no methods.

Related to aws/smithy-go#261
  • Loading branch information
jasdel committed Jan 15, 2021
1 parent d08f647 commit af1f43f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,6 @@ protected void serializeInputDocument(GenerationContext context, OperationShape
writer.openBlock("if err := $L(input, bodyEncoder.Value); err != nil {", "}", functionName, () -> {
writer.write("return out, metadata, &smithy.SerializationError{Err: err}");
}).write("");
} else {
writer.write("_ = input");
writer.write("");
}

writer.write("err = bodyEncoder.Encode()");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ protected void serializeInputDocument(GenerationContext context, OperationShape

// If there are no members then there's nothing to serialize
if (input.members().size() == 0) {
// Prevent warnings caused by input not being used
writer.write("_ = input");
return;
}

Expand Down

0 comments on commit af1f43f

Please sign in to comment.