@@ -201,7 +201,6 @@ public void generateSharedComponents(GenerationContext context) {
201201 generateDocumentBodyShapeDeserializers (context , deserializingDocumentShapes );
202202 HttpProtocolGeneratorUtils .generateMetadataDeserializer (context , getApplicationProtocol ().getResponseType ());
203203 HttpProtocolGeneratorUtils .generateCollectBodyString (context );
204- HttpProtocolGeneratorUtils .generateHttpBindingUtils (context );
205204
206205 writer .write (
207206 context .getStringStore ().flushVariableDeclarationCode ()
@@ -965,6 +964,7 @@ private void writeRequestHeaders(
965964 opening = "const headers: any = {" ;
966965 closing = "};" ;
967966 } else {
967+ writer .addImport ("isSerializableHeaderValue" , null , TypeScriptDependency .AWS_SMITHY_CLIENT );
968968 opening = normalHeaderCount > 0
969969 ? "const headers: any = map({}, isSerializableHeaderValue, {"
970970 : "const headers: any = map({" ;
@@ -1035,6 +1035,8 @@ private void writeNormalHeader(GenerationContext context, HttpBinding binding) {
10351035 : headerValue + defaultValue ;
10361036
10371037 // evaluated value has a function or method call attached
1038+ context .getWriter ()
1039+ .addImport ("isSerializableHeaderValue" , null , TypeScriptDependency .AWS_SMITHY_CLIENT );
10381040 headerBuffer .put (headerKey , String .format (
10391041 "[%s]: [() => isSerializableHeaderValue(%s), () => %s]," ,
10401042 context .getStringStore ().var (headerKey ),
@@ -1093,6 +1095,7 @@ private void writeResponseHeaders(
10931095 TypeScriptWriter writer = context .getWriter ();
10941096
10951097 // Headers are always present either from the default document or the payload.
1098+ writer .addImport ("isSerializableHeaderValue" , null , TypeScriptDependency .AWS_SMITHY_CLIENT );
10961099 writer .openBlock ("let headers: any = map({}, isSerializableHeaderValue, {" , "});" , () -> {
10971100 writeContentTypeHeader (context , operationOrError , false );
10981101 injectExtraHeaders .run ();
@@ -1373,7 +1376,13 @@ private String getCollectionInputParam(
13731376 dataSource = "Array.from(" + dataSource + ".values())" ;
13741377 }
13751378 String collectionTargetValue = getInputValue (context , bindingType , "_entry" , targetMember , collectionTarget );
1376- String iteratedParam = "(" + dataSource + " || []).map(_entry => " + collectionTargetValue + " as any)" ;
1379+ String iteratedParam ;
1380+ if (collectionTargetValue .equals ("_entry" )) {
1381+ iteratedParam = "(" + dataSource + " || [])" ;
1382+ } else {
1383+ iteratedParam = "(" + dataSource + " || []).map(_entry => " + collectionTargetValue + " as any)" ;
1384+ }
1385+
13771386 switch (bindingType ) {
13781387 case HEADER :
13791388 return iteratedParam + ".join(', ')" ;
@@ -2689,20 +2698,25 @@ private String getCollectionOutputParam(
26892698 switch (bindingType ) {
26902699 case QUERY_PARAMS :
26912700 case QUERY :
2701+ if (collectionTargetValue .equals ("_entry" )) {
2702+ return String .format ("%1$s" , dataSource );
2703+ }
26922704 return String .format ("%1$s.map(_entry => %2$s as any)" , dataSource , collectionTargetValue );
26932705 case LABEL :
26942706 dataSource = "(" + dataSource + " || \" \" )" ;
26952707 // Split these values on slashes.
26962708 outputParam = "" + dataSource + ".split('/')" ;
26972709
26982710 // Iterate over each entry and do deser work.
2699- outputParam += ".map(_entry => " + collectionTargetValue + " as any)" ;
2711+ if (!collectionTargetValue .equals ("_entry" )) {
2712+ outputParam += ".map(_entry => " + collectionTargetValue + " as any)" ;
2713+ }
27002714
27012715 return outputParam ;
27022716 case HEADER :
27032717 dataSource = "(" + dataSource + " || \" \" )" ;
27042718 // Split these values on commas.
2705- outputParam = "" + dataSource + ".split(',')" ;
2719+ outputParam = dataSource + ".split(',')" ;
27062720
27072721 // Headers that have HTTP_DATE formatted timestamps already contain a ","
27082722 // in their formatted entry, so split on every other "," instead.
@@ -2719,7 +2733,9 @@ private String getCollectionOutputParam(
27192733 }
27202734
27212735 // Iterate over each entry and do deser work.
2722- outputParam += ".map(_entry => " + collectionTargetValue + " as any)" ;
2736+ if (!collectionTargetValue .equals ("_entry" )) {
2737+ outputParam += ".map(_entry => " + collectionTargetValue + " as any)" ;
2738+ }
27232739
27242740 return outputParam ;
27252741 default :
0 commit comments