Skip to content

Commit eff63bf

Browse files
author
Chase Coalwell
authored
fix parsing non-readable stream (#72)
1 parent 99571a7 commit eff63bf

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
import software.amazon.smithy.model.shapes.NumberShape;
4949
import software.amazon.smithy.model.shapes.OperationShape;
5050
import software.amazon.smithy.model.shapes.Shape;
51+
import software.amazon.smithy.model.shapes.ShapeType;
5152
import software.amazon.smithy.model.shapes.StringShape;
5253
import software.amazon.smithy.model.shapes.StructureShape;
5354
import software.amazon.smithy.model.shapes.TimestampShape;
@@ -717,7 +718,7 @@ private void readReponseBodyData(GenerationContext context, Shape operationOrErr
717718
.map(structure -> structure.getAllMembers().values().stream()
718719
.anyMatch(memberShape -> memberShape.hasTrait(StreamingTrait.class)))
719720
.orElse(false);
720-
if (hasStreamingComponent) {
721+
if (hasStreamingComponent || operationOrError.getType().equals(ShapeType.STRUCTURE)) {
721722
// For operations with streaming output or errors with streaming body we keep the body intact.
722723
writer.write("const data: any = output.body;");
723724
} else {

0 commit comments

Comments
 (0)