You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/protocols/HttpBoundProtocolGenerator.kt
+42-5Lines changed: 42 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -35,7 +35,7 @@ class ClientHttpBoundProtocolPayloadGenerator(
35
35
.expect("a SharedClientProtocol is required")
36
36
.clone();
37
37
let error_marshaller = #{errorMarshallerConstructorFn}(protocol.clone());
38
-
let marshaller = #{marshallerConstructorFn}(protocol);
38
+
let marshaller = #{marshallerConstructorFn}(protocol.clone());
39
39
"""
40
40
} else {
41
41
"""
@@ -78,22 +78,59 @@ private fun eventStreamWithInitialRequest(
78
78
protocol:Protocol,
79
79
params:EventStreamBodyParams,
80
80
): Writable? {
81
-
val parser = protocol.structuredDataSerializer().operationInputSerializer(params.operationShape) ?:returnnull
82
-
83
81
if (codegenContext.protocolImpl?.httpBindingResolver?.handlesEventStreamInitialRequest(params.operationShape) !=true) {
84
82
returnnull
85
83
}
86
84
85
+
val useSchemaSerde =SchemaSerdeAllowlist.usesSchemaSerdeExclusively(codegenContext)
86
+
val parser = protocol.structuredDataSerializer().operationInputSerializer(params.operationShape)
87
+
// Legacy path requires the structured serializer to be available.
88
+
if (!useSchemaSerde && parser ==null) returnnull
89
+
87
90
val smithyHttp =RuntimeType.smithyHttp(codegenContext.runtimeConfig)
88
91
val eventOrInitial = smithyHttp.resolve("event_stream::EventOrInitial")
89
92
val eventOrInitialMarshaller = smithyHttp.resolve("event_stream::EventOrInitialMarshaller")
90
93
94
+
val operationSymbol = codegenContext.symbolProvider.toSymbol(params.operationShape)
95
+
val smithySchema =RuntimeType.smithySchema(codegenContext.runtimeConfig)
0 commit comments