Skip to content

Commit

Permalink
Merge pull request #296 from skmcgrail/fixEnumPayload
Browse files Browse the repository at this point in the history
Fix serialization of enum types marked with payload trait
  • Loading branch information
skmcgrail authored May 13, 2021
2 parents bce8df7 + e31a746 commit 0421f8f
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,11 @@ protected void writeMiddlewarePayloadSerializerDelegator(

} else if (payloadShape.isStringShape()) {
writer.addUseImports(SmithyGoDependency.STRINGS);
writer.write("payload := strings.NewReader(*$L)", s);
if (payloadShape.hasTrait(EnumTrait.class)) {
writer.write("payload := strings.NewReader(string($L))", s);
} else {
writer.write("payload := strings.NewReader(*$L)", s);
}

} else {
writeMiddlewarePayloadAsDocumentSerializerDelegator(context, memberShape, s);
Expand Down

0 comments on commit 0421f8f

Please sign in to comment.