Skip to content

Commit

Permalink
uniform usage of LazyJsonString
Browse files Browse the repository at this point in the history
  • Loading branch information
kuhe committed Dec 9, 2024
1 parent 46a4814 commit 8a2ea83
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ public static String getStringInputParam(GenerationContext context, Shape shape,
if (CodegenUtils.isJsonMediaType(mediaType)) {
TypeScriptWriter writer = context.getWriter();
writer.addImport("LazyJsonString", "__LazyJsonString", TypeScriptDependency.AWS_SMITHY_CLIENT);
return "__LazyJsonString.fromObject(" + dataSource + ")";
return "__LazyJsonString.from(" + dataSource + ")";
} else {
LOGGER.warning(() -> "Found unsupported mediatype " + mediaType + " on String shape: " + shape);
}
Expand Down Expand Up @@ -210,7 +210,7 @@ public static String getStringOutputParam(GenerationContext context,
if (CodegenUtils.isJsonMediaType(mediaType)) {
TypeScriptWriter writer = context.getWriter();
writer.addImport("LazyJsonString", "__LazyJsonString", TypeScriptDependency.AWS_SMITHY_CLIENT);
return "new __LazyJsonString(" + dataSource + ")";
return "__LazyJsonString.from(" + dataSource + ")";
} else {
LOGGER.warning(() -> "Found unsupported mediatype " + mediaType + " on String shape: " + shape);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public static Collection<Object[]> validMemberTargetTypes() {
{StringShape.builder().id(id).build(), "__expectString(" + DATA_SOURCE + ")", source},
{
StringShape.builder().id(id).addTrait(new MediaTypeTrait("foo+json")).build(),
"new __LazyJsonString(" + DATA_SOURCE + ")",
"__LazyJsonString.from(" + DATA_SOURCE + ")",
source
},
{BlobShape.builder().id(id).build(), "context.base64Decoder(" + DATA_SOURCE + ")", source},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public static Collection<Object[]> validMemberTargetTypes() {
{StringShape.builder().id(id).build(), DATA_SOURCE},
{
StringShape.builder().id(id).addTrait(new MediaTypeTrait("foo+json")).build(),
"__LazyJsonString.fromObject(" + DATA_SOURCE + ")"
"__LazyJsonString.from(" + DATA_SOURCE + ")"
},
{BlobShape.builder().id(id).build(), "context.base64Encoder(" + DATA_SOURCE + ")"},
{DocumentShape.builder().id(id).build(), delegate},
Expand Down

0 comments on commit 8a2ea83

Please sign in to comment.