Skip to content

Commit ff1992f

Browse files
trivikrsrchase
authored andcommitted
Replace isNativeSimpleType with Boolean/Number check (smithy-lang#310)
1 parent 2b824e9 commit ff1992f

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
@@ -158,16 +158,6 @@ public void generateSharedComponents(GenerationContext context) {
158158
HttpProtocolGeneratorUtils.generateHttpBindingUtils(context);
159159
}
160160

161-
/**
162-
* Detects if the target shape is expressed as a native simple type.
163-
*
164-
* @param target The shape of the value being provided.
165-
* @return Returns if the shape is a native simple type.
166-
*/
167-
private boolean isNativeSimpleType(Shape target) {
168-
return target instanceof BooleanShape || target instanceof NumberShape || target instanceof StringShape;
169-
}
170-
171161
@Override
172162
public void generateRequestSerializers(GenerationContext context) {
173163
TopDownIndex topDownIndex = TopDownIndex.of(context.getModel());
@@ -865,7 +855,7 @@ protected String getInputValue(
865855
} else if (target instanceof FloatShape || target instanceof DoubleShape) {
866856
// Handle decimal numbers needing to have .0 in their value when whole numbers.
867857
return "((" + dataSource + " % 1 == 0) ? " + dataSource + " + \".0\" : " + dataSource + ".toString())";
868-
} else if (isNativeSimpleType(target)) {
858+
} else if (target instanceof BooleanShape || target instanceof NumberShape) {
869859
return dataSource + ".toString()";
870860
} else if (target instanceof TimestampShape) {
871861
return getTimestampInputParam(context, bindingType, dataSource, member);

0 commit comments

Comments
 (0)