Skip to content

Commit

Permalink
EventStream Fixes (#1647)
Browse files Browse the repository at this point in the history
  • Loading branch information
skmcgrail authored Mar 30, 2022
1 parent b03e3da commit f9446dc
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,7 @@ private static void generateEventStreamWriter(
var writeCloser = getSymbol("WriteCloser", SmithyGoDependency.IO);
var signerInterface = getModuleSymbol(settings, EVENT_STREAM_SIGNER_INTERFACE);

var messageSymbol = getEventStreamSymbol("Message", false);
var messageSymbol = getEventStreamSymbol("Message", true);

if (withInitialMessages) {
generateEventStreamWriterMessageWrapper(eventStream, service, symbolProvider, writer, eventUnionSymbol);
Expand Down Expand Up @@ -937,6 +937,9 @@ private static void generateEventStreamWriter(
writer.write("w.serializationBuffer.Reset()").write("")
.write("eventMessage := $T{}", messageSymbol).write("");

var eventStreamSerializerName = getEventStreamSerializerName(eventStream, service,
context.getProtocolName());

if (withInitialMessages) {
var initialRequestType = getWriterEventWrapperInitialRequestType(symbolProvider, eventStream,
service);
Expand All @@ -956,14 +959,14 @@ private static void generateEventStreamWriter(
default:
return nil, $T("unknown event wrapper type: %v", event)
}
""", initialRequestType, messageEventType, errorf);
""", initialRequestType, messageEventType, eventStreamSerializerName, errorf);
} else {
writer.write("""
if err := $L(event, &eventMessage); err != nil {
return nil, err
}
""",
getEventStreamSerializerName(eventStream, service, context.getProtocolName()));
eventStreamSerializerName);
}

writer.write("""
Expand Down

0 comments on commit f9446dc

Please sign in to comment.