@@ -2403,7 +2403,7 @@ private String getOutputValue(
2403
2403
if (target instanceof NumberShape ) {
2404
2404
return getNumberOutputParam (bindingType , dataSource , target );
2405
2405
} else if (target instanceof BooleanShape ) {
2406
- return getBooleanOutputParam (bindingType , dataSource );
2406
+ return getBooleanOutputParam (context , bindingType , dataSource );
2407
2407
} else if (target instanceof StringShape ) {
2408
2408
return getStringOutputParam (context , bindingType , dataSource , target );
2409
2409
} else if (target instanceof DocumentShape ) {
@@ -2427,21 +2427,21 @@ private String getOutputValue(
2427
2427
2428
2428
/**
2429
2429
* Given context and a source of data, generate an output value provider for the
2430
- * boolean. By default, this checks strict equality to 'true'in headers and passes
2430
+ * boolean. By default, this checks strict equality to 'true' in headers and passes
2431
2431
* through for documents.
2432
2432
*
2433
2433
* @param bindingType How this value is bound to the operation output.
2434
2434
* @param dataSource The in-code location of the data to provide an output of
2435
2435
* ({@code output.foo}, {@code entry}, etc.)
2436
2436
* @return Returns a value or expression of the output boolean.
2437
2437
*/
2438
- private String getBooleanOutputParam (Location bindingType , String dataSource ) {
2438
+ private String getBooleanOutputParam (GenerationContext context , Location bindingType , String dataSource ) {
2439
2439
switch (bindingType ) {
2440
- // TODO: make sure this actually works
2441
2440
case QUERY :
2442
2441
case LABEL :
2443
2442
case HEADER :
2444
- return dataSource + " === 'true'" ;
2443
+ context .getWriter ().addImport ("parseBoolean" , "__parseBoolean" , "@aws-sdk/smithy-client" );
2444
+ return String .format ("__parseBoolean(%s)" , dataSource );
2445
2445
default :
2446
2446
throw new CodegenException ("Unexpected boolean binding location `" + bindingType + "`" );
2447
2447
}
@@ -2487,7 +2487,6 @@ private String getBlobOutputParam(Location bindingType, String dataSource) {
2487
2487
switch (bindingType ) {
2488
2488
case PAYLOAD :
2489
2489
return dataSource ;
2490
- // TODO: make sure this actually works
2491
2490
case QUERY :
2492
2491
case LABEL :
2493
2492
case HEADER :
@@ -2604,7 +2603,6 @@ private String getNamedMembersOutputParam(
2604
2603
*/
2605
2604
private String getNumberOutputParam (Location bindingType , String dataSource , Shape target ) {
2606
2605
switch (bindingType ) {
2607
- // TODO: validate the assumption that query works the same here
2608
2606
case QUERY :
2609
2607
case LABEL :
2610
2608
case HEADER :
0 commit comments