Skip to content

Commit 89b7e6f

Browse files
AllanZhengYPkstich
authored andcommitted
fix request default endpoints from serde context being overridden
1 parent fcf5861 commit 89b7e6f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/integration/HttpBindingProtocolGenerator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,6 @@ private void generateOperationSerializer(
228228
}
229229

230230
writer.openBlock("return new $T({", "});", requestType, () -> {
231-
writer.write("...context.endpoint,");
232231
if (hasHostPrefix) {
233232
writer.write("hostname: resolvedHostname,");
234233
}
@@ -248,6 +247,7 @@ private void generateOperationSerializer(
248247
}
249248
// Always set the body,
250249
writer.write("body: body,");
250+
writer.write("...context.endpoint,");
251251
});
252252
});
253253

smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/integration/HttpRpcProtocolGenerator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,11 @@ public void generateSharedComponents(GenerationContext context) {
108108
+ " body: any,\n"
109109
+ "): $T => {", "};", requestType, () -> {
110110
writer.openBlock("const contents: any = {", "};", () -> {
111-
writer.write("...context.endpoint,");
112111
writer.write("protocol: \"https\",");
113112
writer.write("method: \"POST\",");
114113
writer.write("path: path,");
115114
writer.write("headers: headers,");
115+
writer.write("...context.endpoint,");
116116
});
117117
writer.openBlock("if (resolvedHostname !== undefined) {", "}", () -> {
118118
writer.write("contents.hostname = resolvedHostname;");

0 commit comments

Comments
 (0)