Skip to content

Commit 2ab214d

Browse files
committed
correct location of union deser import
1 parent b401bd9 commit 2ab214d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
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
@@ -2469,7 +2469,6 @@ private HttpBinding readPayload(
24692469
+ "= __expectObject(await parseBody(output.body, context));");
24702470
} else if (target instanceof UnionShape) {
24712471
// If payload is a Union, then we need to parse the string into JavaScript object.
2472-
importUnionDeserializer(writer);
24732472
writer.write("const data: Record<string, any> | undefined "
24742473
+ "= await parseBody(output.body, context);");
24752474
} else if (target instanceof StringShape || target instanceof DocumentShape) {
@@ -2485,6 +2484,7 @@ private HttpBinding readPayload(
24852484
"if (Object.keys(data ?? {}).length) {",
24862485
"}",
24872486
() -> {
2487+
importUnionDeserializer(writer);
24882488
writer.write("contents.$L = __expectUnion($L);", binding.getMemberName(), getOutputValue(context,
24892489
Location.PAYLOAD, "data", binding.getMember(), target));
24902490
}

0 commit comments

Comments
 (0)