Skip to content

Commit de36124

Browse files
authored
Replace isNativeSimpleType with Boolean/Number check (#310)
1 parent 2484093 commit de36124

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/integration/HttpBindingProtocolGenerator.java

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -147,16 +147,6 @@ public void generateSharedComponents(GenerationContext context) {
147147
HttpProtocolGeneratorUtils.generateHttpBindingUtils(context);
148148
}
149149

150-
/**
151-
* Detects if the target shape is expressed as a native simple type.
152-
*
153-
* @param target The shape of the value being provided.
154-
* @return Returns if the shape is a native simple type.
155-
*/
156-
private boolean isNativeSimpleType(Shape target) {
157-
return target instanceof BooleanShape || target instanceof NumberShape || target instanceof StringShape;
158-
}
159-
160150
@Override
161151
public void generateRequestSerializers(GenerationContext context) {
162152
TopDownIndex topDownIndex = TopDownIndex.of(context.getModel());
@@ -452,7 +442,7 @@ protected String getInputValue(
452442
} else if (target instanceof FloatShape || target instanceof DoubleShape) {
453443
// Handle decimal numbers needing to have .0 in their value when whole numbers.
454444
return "((" + dataSource + " % 1 == 0) ? " + dataSource + " + \".0\" : " + dataSource + ".toString())";
455-
} else if (isNativeSimpleType(target)) {
445+
} else if (target instanceof BooleanShape || target instanceof NumberShape) {
456446
return dataSource + ".toString()";
457447
} else if (target instanceof TimestampShape) {
458448
return getTimestampInputParam(context, bindingType, dataSource, member);

0 commit comments

Comments
 (0)