Skip to content

Commit 0c9872f

Browse files
chore: don't overly type map serialization
1 parent a440491 commit 0c9872f

File tree

1 file changed

+2
-4
lines changed
  • codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen

1 file changed

+2
-4
lines changed

codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/JsonShapeSerVisitor.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,8 @@ public void serializeMap(GenerationContext context, MapShape shape) {
9494

9595
// Get the right serialization for each entry in the map. Undefined
9696
// inputs won't have this serializer invoked.
97-
writer.openBlock("return Object.entries(input).reduce((acc: $T, [key, value]: [$T, any]) => {",
98-
"}, {});",
99-
symbolProvider.toSymbol(shape),
100-
symbolProvider.toSymbol(shape.getKey()),
97+
writer.openBlock("return Object.entries(input).reduce((acc: {[key: string]: any}, "
98+
+ "[key, value]: [$1T, any]) => {", "}, {});", symbolProvider.toSymbol(shape.getKey()),
10199
() -> {
102100
writer.openBlock("if (value === null) {", "}", () -> {
103101
// Handle the sparse trait by short circuiting null values

0 commit comments

Comments
 (0)