Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

codegen: Updates SDK's generated serde for unmodeled operation input/output #1050

Merged
merged 4 commits into from
Jan 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,9 @@ private static String getSerializedXMLShapeName(ProtocolGenerator.GenerationCont
Optional<SyntheticClone> clone = shape.getTrait(SyntheticClone.class);
if (clone.isPresent()) {
SyntheticClone cl = clone.get();
shapeName = cl.getArchetype().getName();
if (cl.getArchetype().isPresent()) {
shapeName = cl.getArchetype().get().getName();
}
jasdel marked this conversation as resolved.
Show resolved Hide resolved
}

// check if shape is member shape
Expand Down
54 changes: 54 additions & 0 deletions internal/protocoltest/awsrestjson/deserializers.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading