Skip to content

Commit 2c12355

Browse files
authored
fix(codegen): fix unknown union member serialization (#1526)
1 parent 6cd14ef commit 2c12355

File tree

1 file changed

+1
-1
lines changed
  • smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/protocols/cbor

1 file changed

+1
-1
lines changed

smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/protocols/cbor/CborShapeSerVisitor.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ protected void serializeUnion(ProtocolGenerator.GenerationContext context, Union
158158
writer.write("$L: value => ({ $S: $L }),", memberName, memberName,
159159
target.accept(getMemberVisitor("value")));
160160
});
161-
writer.write("_: (name, value) => ({ name: value } as any)");
161+
writer.write("_: (name, value) => ({ [name]: value } as any)");
162162
});
163163
}
164164

0 commit comments

Comments
 (0)