diff --git a/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/endpointsV2/RuleSetParameterFinder.java b/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/endpointsV2/RuleSetParameterFinder.java index 1850952aa04..99678b75658 100644 --- a/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/endpointsV2/RuleSetParameterFinder.java +++ b/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/endpointsV2/RuleSetParameterFinder.java @@ -28,6 +28,7 @@ import software.amazon.smithy.model.shapes.OperationShape; import software.amazon.smithy.model.shapes.ServiceShape; import software.amazon.smithy.model.shapes.Shape; +import software.amazon.smithy.model.shapes.ShapeType; import software.amazon.smithy.rulesengine.traits.ClientContextParamsTrait; import software.amazon.smithy.rulesengine.traits.ContextParamTrait; import software.amazon.smithy.rulesengine.traits.EndpointRuleSetTrait; @@ -68,10 +69,22 @@ public Map getClientContextParams() { if (trait.isPresent()) { ClientContextParamsTrait clientContextParamsTrait = trait.get(); clientContextParamsTrait.getParameters().forEach((name, definition) -> { - map.put( - name, - definition.getType().toString().toLowerCase() // "boolean" and "string" are directly usable in TS. - ); + ShapeType shapeType = definition.getType(); + if (shapeType.isShapeType(ShapeType.STRING) || shapeType.isShapeType(ShapeType.BOOLEAN)) { + map.put( + name, + definition.getType().toString().toLowerCase() // "boolean" and "string" are directly usable in TS. + ); + } else if (shapeType.isShapeType(ShapeType.LIST)) { + map.put( + name, + "string[]" // Only string lists are supported. + ); + } else { + throw new RuntimeException("unexpected type " + + definition.getType().toString() + + " received as clientContextParam."); + } }); } return map;